PARAMETERS RMB
IF VARTYPE(RMB)!=[N] OR LEN(TRANSFORM(INT(RMB*100)))>15
MESSAGEBOX([非数值型数据或数据长度超出范围],64,[系统信息])
RETURN []
ENDIF
RMB=TRANSFORM(INT(RMB*100))
NLEN=LEN(RMB)
DXSJ=[零壹贰叁肆伍陆柒捌玖]
DXDW=[万仟佰拾亿仟佰拾万仟佰拾元角分]
DXDW_R=RIGHT(DXDW,NLEN*2)
STORE [] TO DX,DXSJ_1,DXDW_1
JS=0 && 保存连续[0]的个数
FOR I=1 TO NLEN
DXSJ_1=SUBSTR(DXSJ,VAL(SUBSTR(RMB,I,1))*2+1,2)
DXDW_1=SUBSTR(DXDW_R,I*2-1,2)
IF DXSJ_1=[零]
DXSJ_1=[]
IF !DXDW_1$IIF(NLEN<=10,[万元],[亿元])
DXDW_1=[]
ENDIF
JS=JS+1
ELSE
IF JS>0 AND !(RIGHT(DX,2)+DXDW_1)$DXDW_R
DXSJ_1=[零]+DXSJ_1
ENDIF
JS=0
ENDIF
DX=DX+DXSJ_1+DXDW_1
ENDFOR
RETURN DX+IIF(RIGHT(RMB,1)=[0],[整],[])
人民币小写转大写[修正版]
最新推荐文章于 2019-04-19 16:36:01 发布