阿拉伯数字转人民币大写测试版

来源:互联网 发布:007网盘搜索引擎源码 编辑:程序博客网 时间:2024/04/29 12:04
SET CONSOLE OFF text说明整数位:最多12位,小数位:最多2位调用方法:rmbdx(100000000000.30)endtextMessageBox(rmbdx(100200000000.30))Function rmbdxlparameters count1z1="仟佰拾亿仟佰拾万仟佰拾元角分"z2="零壹贰叁肆伍陆柒捌玖"lcstr=Alltrim(Padl(Int(count1*100),16))lcdx=""For lnI=1 to Len(lcstr)    lcdx=lcdx+Substr(z2,(Val(Substr(lcstr,lnI,1))*2)+1,2)    lcdx=lcdx+Substr(Right(z1,Len(lcstr)*2),(lnI-1)*2+1,2)EndFor *lcdx=Strtran(lcdx,"零亿","亿")*lcdx=Strtran(lcdx,"零万","万")lcdx=Strtran(lcdx,"零仟","零")lcdx=Strtran(lcdx,"零佰","零")lcdx=Strtran(lcdx,"零拾","零")Do while "零零"$lcdx    lcdx=Strtran(lcdx,"零零","零")EndDo lcdx=Strtran(lcdx,"零亿","亿")lcdx=Strtran(lcdx,"零万","万")lcdx=Strtran(lcdx,"亿万","亿")lcdx=Strtran(lcdx,"零元","元")lcdx=Strtran(lcdx,"零角零分","整")lcdx=Strtran(lcdx,"零角","零")lcdx=Strtran(lcdx,"零分","整")Return lcdx

0 0
原创粉丝点击