主题:wzxc老师有问题请问
老师好,我按你做的大写人民币,一直运行很好,但我想把小数点(分、角)取掉,如何办呢?谢谢老师
PARAMETERS nAmount
PRIVATE ALL LIKE L_*
#define L_S1 "零壹贰叁肆伍陆柒捌玖"
#define L_S2 "亿仟佰拾万仟佰拾亿仟佰拾万仟佰拾元角分"
nAmount=LTRIM(STR(nAmount*100,LEN(L_S2)/2))
L_LEN=LEN(nAmount)
L_SS2=RIGHT(L_S2,2*L_LEN)
L_DX=""
L_0JS=0 && 连续零的个数
L_N=0
DO WHILE L_N<L_LEN
L_N=L_N+1
L_SZ=SUBSTR(nAmount,L_N,1)
L_SZ=SUBSTR(L_S1,2*VAL(L_SZ)+1,2)
L_DW=SUBSTR(L_SS2,2*L_N-1,2)
IF L_SZ='零'
L_SZ=""
DO CASE
CASE L_DW$"亿元"
CASE L_DW="万"
IF RIGHT(L_DX,2)="亿"
L_DW=""
ENDIF
OTHERWISE
L_DW=""
ENDCASE
L_0JS=L_0JS+1
ELSE
IF L_0JS>0
L_SZ="零"+L_SZ
ENDIF
L_0JS=0
ENDIF
L_DX=L_DX+L_SZ+L_DW
ENDDO
L_DX=L_DX+IIF(RIGHT(nAmount,1)="0","整","")
RETURN L_DX
PARAMETERS nAmount
PRIVATE ALL LIKE L_*
#define L_S1 "零壹贰叁肆伍陆柒捌玖"
#define L_S2 "亿仟佰拾万仟佰拾亿仟佰拾万仟佰拾元角分"
nAmount=LTRIM(STR(nAmount*100,LEN(L_S2)/2))
L_LEN=LEN(nAmount)
L_SS2=RIGHT(L_S2,2*L_LEN)
L_DX=""
L_0JS=0 && 连续零的个数
L_N=0
DO WHILE L_N<L_LEN
L_N=L_N+1
L_SZ=SUBSTR(nAmount,L_N,1)
L_SZ=SUBSTR(L_S1,2*VAL(L_SZ)+1,2)
L_DW=SUBSTR(L_SS2,2*L_N-1,2)
IF L_SZ='零'
L_SZ=""
DO CASE
CASE L_DW$"亿元"
CASE L_DW="万"
IF RIGHT(L_DX,2)="亿"
L_DW=""
ENDIF
OTHERWISE
L_DW=""
ENDCASE
L_0JS=L_0JS+1
ELSE
IF L_0JS>0
L_SZ="零"+L_SZ
ENDIF
L_0JS=0
ENDIF
L_DX=L_DX+L_SZ+L_DW
ENDDO
L_DX=L_DX+IIF(RIGHT(nAmount,1)="0","整","")
RETURN L_DX