SET CONSOLE OFF
text
说明
整数位:最多12位,小数位:最多2位
调用方法:rmbdx(100000000000.30)
endtext
MessageBox(rmbdx(100200000000.30))
Function rmbdx
lparameters count1
z1="仟佰拾亿仟佰拾万仟佰拾元角分"
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
阿拉伯数字转人民币大写测试版
最新推荐文章于 2021-12-11 01:49:49 发布