我自己编的,好辛苦给点悬赏把时输入代码text1.text=numbertocharacter(text2.text)源如下option explicitpublic function numbertocharacter(number as string) as string'完成转换的主函数dim pos_point as long '记数点的位置dim curnum as string '记录当前处理的数字dim zhengshu as string '记录整数部分dim shuduan as string '截取某一个数据段'检索小数点的位置pos_point = instr(number, ".")'处理小数部分if pos_point = 0 then'没有小数点,将小数点设置在最末尾pos_point = len(number)elseif len(number) = pos_point then'以小数点结尾,不作处理elseif len(number) = pos_point + 1 then'一位小数,直接翻译为角curnum = right(number, 1)numbertocharacter = numtochr(curnum) & "角"elseif len(number) = pos_point + 2 then'取第一位curnum = right(number, 1)'若第一位为零,则不作处理,否则译为“角”if curnum <> "0" thennumbertocharacter = numtochr(curnum) & "分"end if'取第二位curnum = left(right(number, 2), 1)'若第二为零,不作处理,否则译为“分”if curnum <> "0" thennumbertocharacter = numtochr(curnum) & "角" & numbertocharacterend ifend if'处理整数zhengshu = ""if pos_point > 14 then'大于 9999999999999 的数据不转换msgbox "该数据无法转换", vbokonly + vb**rmation, "金额转换"exit functionelseif pos_point > 9 thenzhengshu = "亿"'亿位以上的部分shuduan = left(number, pos_point - 9)zhengshu = shuduantocharacter(shuduan) & zhengshu'万位以上的部分shuduan = right(left(number, pos_point - 5), 4)zhengshu = zhengshu & shuduantocharacter(shuduan) & "万"'万位以下部分shuduan = right(left(number, pos_point - 1), 4)zhengshu = zhengshu & shuduantocharacter(shuduan) & "圆"elseif pos_point > 5 then'万位以上的部分shuduan = right(left(number, pos_point - 5), 4)zhengshu = zhengshu & shuduantocharacter(shuduan) & "万"'万位以下部分shuduan = right(left(number, pos_point - 1), 4)zhengshu = zhengshu & shuduantocharacter(shuduan) & "圆"else'万位以下shuduan = right(left(number, pos_point - 1), 4)zhengshu = zhengshu & shuduantocharacter(shuduan) & "圆"end ifnumbertocharacter = zhengshu & numbertocharacter'输入为“0”,特殊处理if numbertocharacter = "圆" thennumbertocharacter = "零圆"end ifend functionpublic function numtochr(num as string) as string'数字转化为对应的中文select case numcase "1"numtochr = "壹"case "2"numtochr = "贰"case "3"numtochr = "参"case "4"numtochr = "肆"case "5"numtochr = "伍"case "6"numtochr = "陆"case "7"numtochr = "柒"case "8"numtochr = "捌"case "9"numtochr = "玖"case "0"numtochr = "零"end selectend function'对分节后的每一节数据进行翻译,'例如: 1234512341234被分为12345,1234,1234public function shuduantocharacter(duan as string) as stringdim curnum as stringdim answer as stringanswer = ""if len(duan) = 5 then'有万位answer = numtochr(left(duan, 1)) & "万"'千位curnum = right(left(duan, 2), 1)if curnum <> "0" thenanswer = answer & numtochr(curnum) & "仟"elseanswer = answer & "零"end if'百位curnum = right(left(duan, 3), 1)if curnum <> "0" thenanswer = answer & numtochr(curnum) & "佰"elseif right(answer, 1) <> "零" thenanswer = answer & "零"end ifend if'十位curnum = right(left(duan, 4), 1)if curnum <> "0" thenanswer = answer & numtochr(curnum) & "拾"elseif right(answer, 1) <> "零" thenanswer = answer & "零"end ifend if'个位curnum = right(duan, 1)if curnum <> "0" thenanswer = answer & numtochr(curnum)elseif right(answer, 1) = "零" thenanswer = left(answer, len(answer) - 1)end ifend ifelseif len(duan) = 4 then'有千位answer = numtochr(left(duan, 1)) & "仟"'百位curnum = left(right(duan, 3), 1)if curnum <> "0" thenanswer = answer & numtochr(curnum) & "佰"elseif right(answer, 1) <> "零" thenanswer = answer & "零"end ifend if'十位curnum = left(right(duan, 2), 1)if curnum <> "0" thenanswer = answer & numtochr(curnum) & "拾"elseif right(answer, 1) <> "零" thenanswer = answer & "零"end ifend if'个位curnum = right(duan, 1)if curnum <> "0" thenanswer = answer & numtochr(curnum)elseif right(answer, 1) = "零" thenanswer = left(answer, len(answer) - 1)end ifend ifelseif len(duan) = 3 then'有百位answer = numtochr(left(duan, 1)) & "佰"'十位curnum = left(right(duan, 2), 1)if curnum <> "0" thenanswer = answer & numtochr(curnum) & "拾"elseif right(answer, 1) <> "零" thenanswer = answer & "零"end ifend if'个位curnum = right(duan, 1)if curnum <> "0" thenanswer = answer & numtochr(curnum)elseif right(answer, 1) = "零" thenanswer = left(answer, len(answer) - 1)end ifend ifelseif len(duan) = 2 then'有十位answer = numtochr(left(duan, 1)) & "拾"'个位curnum = right(duan, 1)if curnum <> "0" thenanswer = answer & numtochr(curnum)elseif right(answer, 1) = "零" thenanswer = left(answer, len(answer) - 1)end ifend ifelseif len(duan) = 1 then'有个位answer = numtochr(left(duan, 1))end ifshuduantocharacter = answerend function 20210311