小写人民币转大写人民币

洓瑟莵 2024-11-15 08:46:36
最佳回答
我自己编的,好辛苦给点悬赏把时输入代码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
汇率兑换计算器

类似问答
  • 人民币大写
    • 2024-11-15 03:14:03
    • 提问者: 未知
    汉字大写金额数字,一律用正楷字或行书字书写,如壹(▲)、贰(▲)、叁、肆(▲)、伍(▲)、陆(▲)、柒、捌、玖、拾(▲)、佰、仟、万(▲)、亿、圆(元)、角、分、零、整(正)等易于辨认、不易涂改的字样。不得用一、二(两)、三、四、五、六、七、八、九、十、念、毛、▲、另(或0)等字样代替,不得任意自造简化字。(注:由于计算机内没有行书字体,所以上面的行书字都未打上。) 大写金额数字到元或角为止的,在...
  • 人民币小写金额转换大写金额
    • 2024-11-15 14:21:47
    • 提问者: 未知
    其实不用什么软件,这个通过excel就可以搞定的.要将人民币小写金额转换成大写格式,用excel提供的格式,将自定义格式类型中的“[dbnum2]g/通用格式”改为“[dbnum2] g/通用格式“元””来实现。但在转换小数时却出现了问题,比如¥6,050.09只能转换为“陆仟零伍拾.零玖圆”。那么用excel能不能解决这一先天不足呢?其方法有以下两种(以下均对b1转换,假设b1是通过函数roun...
  • 急求人民币大小写转换代码
    • 2024-11-15 19:19:35
    • 提问者: 未知
    '将**伯数字表示的金额转换为中文大写 function strucasemoney(byval albmoney) dim strdecimal,i,j,strtemp albmoney=trim(albmoney&"") i=instr(albmoney,".") if i=0 then i=len(albmoney)+1 else strdecimal=mid(albmoney,i+1) e...
  • 一万人民币小写写法
    • 2024-11-15 10:03:50
    • 提问者: 未知
    小写数字为 :¥10,0001:严谨一点来说:人民币的符号是¥,不是¥,2:后面的元不多余,因为¥只表示币种是人民币,而不代表单位,3:数字格式是标准格式,人民币的最小单位就是分,即“:小数点后两位!4:写成国际通用的rmb或者cny更好,毕竟互联网是跨国界的,人民币也非国际货币,显然¥跟美金标识$和欧元标识€比起来,老外还真不大懂,小写金额的会计标准写法小写金额的标准写法。 ①在没有数位分隔线的...
  • 人民币108000大写怎么写?
    • 2024-11-15 04:56:45
    • 提问者: 未知
    壹拾万捌仟元整 是正确的写法。你要理解填写“零”的含义。“零”的含义在于取代一个位数,例如千位、百位、十位,防止涂写。而万前面的数字是一个整体,被“万”字管牢了...
  • 141563.8人民币大写怎么写
    • 2024-11-15 01:52:37
    • 提问者: 未知
    141563.8人民币大写怎么写请看141563.8人民币的大写:人民币壹拾肆万壹仟伍佰陆拾叁元捌角整
  • 131000人民币大写怎么写
    • 2024-11-15 22:38:45
    • 提问者: 未知
    壹拾叁万壹仟整
  • 人民币15000.10大写怎么写
    • 2024-11-15 04:56:47
    • 提问者: 未知
    壹万伍仟元零壹角整
  • 人民币67.894.44元转大写
    • 2024-11-15 10:39:34
    • 提问者: 未知
    人民币67894.44元大写应该是:陆万柒仟捌佰玖拾肆元肆角肆分,请采纳!
  • j**ascript html 人民币 小写变大写
    • 2024-11-15 12:14:13
    • 提问者: 未知
    function changenummoneytochinese(money){ var cnnums=new array("零","壹","贰","叁","肆","伍","陆","柒","捌","玖");var cnintradice=new array("","拾","佰","仟");var cnintunits=new array("","万","亿","兆");var cndecunits...
汇率兑换计算器

热门推荐
热门问答
最新问答
推荐问答
新手帮助
常见问题
房贷计算器-九子财经 | 备案号: 桂ICP备19010581号-1 商务联系 企鹅:2790-680461

特别声明:本网为公益网站,人人都可发布,所有内容为会员自行上传发布",本站不承担任何法律责任,如内容有该作者著作权或违规内容,请联系我们清空删除。