人民币大写改进版

作者在 2015-02-17 22:18:22 发布以下内容
MessageBox(dx(987600004321))
Function dx
lparameters Num
z1="分角元拾佰仟万拾佰仟亿拾佰仟"
z2="零壹贰叁肆伍陆柒捌玖"
Num=Int(Num*100)
*MessageBox(num)
lcdx=""
For lnI=Len(Alltrim(Str(Num,16)))-1 to 0 step -1
    lcdx=lcdx+Substr(z2,int(Num/10^lnI)*2+1,2)
    lcdx=lcdx+Substr(z1,lnI*2+1,2)
    Num=MOD(Num,10^lnI)
EndFor 
*MessageBox(lcdx,0,"第一步")
*lcdx=Strtran(lcdx,"零亿","亿")
*lcdx=Strtran(lcdx,"零万","万")
lcdx=Strtran(lcdx,"零仟","零")
lcdx=Strtran(lcdx,"零佰","零")
lcdx=Strtran(lcdx,"零拾","零")
*MessageBox(lcdx,0,"第二步")
Do while "零零"$lcdx
   lcdx=Strtran(lcdx,"零零","零")
EndDo 
*MessageBox(lcdx,0,"第三步")
lcdx=Strtran(lcdx,"零亿","亿")
lcdx=Strtran(lcdx,"零万","万")
lcdx=Strtran(lcdx,"亿万","亿")
lcdx=Strtran(lcdx,"零元","元")
lcdx=Strtran(lcdx,"零角零分","整")
lcdx=Strtran(lcdx,"零角","零")
lcdx=Strtran(lcdx,"零分","整")
Return lcdx
算法 | 阅读 1638 次
文章评论,共1条
定燃民每(游客)
2018-04-04 19:12
1
游客请输入验证码
浏览402246次