public function numtochinese(number as double) as string const ex as string = "仟佰拾亿仟佰拾万仟佰
先抢个位置,中午帮你解答! 你的语句错误地方:少n2c函数和retstr <>restr,要仔细啊public function numtochinese(number as double) as stringconst ex as string = "仟佰拾亿仟佰拾万仟佰拾元角分"dim numstr as string, extmp as string, retstr as stringdim l as integer, i as integernumber = number * 100numstr = ltrim(str(int(number)))l = len(numstr)extmp = right(ex, l)retstr = ""for i = 1 to l restr = restr & n2c(val(mid(numstr, i, 1))) & mid(extmp, i, 1) 'mid函数,用于截取字符next inumtochinese = restr & "整"end functionprivate sub form_click()me.autoredraw = trueclsprintprint "人民币金额大小写转换"print "================================================================="print tab(12); 1300689067.89print tab(12); numtochinese(1300689067.89)print "================================================================="end subpublic function n2c(byval i as integer) as string '数值转换成大写字符select case i case 0 n2c = "零" case 1 n2c = "壹" case 2 n2c = "贰" case 3 n2c = "叁" case 4 n2c = "肆" case 5 n2c = "伍" case 6 n2c = "陆" case 7 n2c = "柒" case 8 n2c = "捌" case 9 n2c = "玖" end selectend function 20210311