Convert the lowercase of the currency to uppercase, for example: 佰 圆 捌 柒 柒

xiaoxiao2021-03-06  94

'Convert the lowercase of the currency to uppercase, for example: 佰 圆 捌 柒 柒

Public Function Num2chi (Byval Txtje As Double) AS String

DIM I, K AS INTEGER

DIM NC, ND, KA, CHRNUM, STRZHENG AS STRING

DIM C1, C2, C3 AS STRING

DIM K1 AS INTEGER

DIM Zheng as string

Dim xiao as string

NC = Trim (Format (TXTJE, "## 0.00")))

C1 = "佰 万 万 元"

C2 = "angle"

C3 = "捌柒 捌柒 肆 壹"

IF nc = 0 THEN

Num2chi = "Zero Yuan"

EXIT FUNCTION

END IF

Num2chi = ""

ZHENG = MID (NC, 1, (LEN (NC) - 3))

XIAO = MID (NC, (Len (zheng) 2))

IF Val (xiao) <> 0 THEN

For i = len (xiao) to 1 step -1

Chrnum = MID (xiao, i, 1)

IF chrnum <> 0 THEN

Num2chi = MID (C2, I, 1) & Num2chi

Num2chi = MID (C3, (Len (C3) - Chrnum 1), 1) & Num2chi

END IF

Next i

END IF

K = 0

IF VAL (zheng) <> 0 THEN

Num2chi = "Yuan" & Num2chi

For i = len (zheng) to 1 step -1

IF (Len (zheng) - i) = 4 THEN

Num2chi = "10,000" & num2chi

Elseif (Len (zheng) - i) = 8 THEN

Num2chi = "100 million" & num2chi

Elseif (Len (zheng) - i) = 12 THEN

Num2chi = "10,000" & num2chi

END IF

Chrnum = MID (zheng, i, 1)

IF chrnum <> 0 THEN

IF i = len (zheng) THEN

Num2chi = MID (C3, (Len (C3) - Chrnum 1), 1) & Num2chi

Else

IF (Len (zheng) - i) <> 4 and (zheng) - i) <> 8 and (zheng) - i) <> 12 THEN

Num2chi = MID (C1, (Len (C1) - K), 1) & Num2chi

END IF

Num2chi = MID (C3, (Len (C3) - Chrnum 1), 1) & Num2chi

END IF

Else

IF MID (Num2chi, 1, 1) <> "Yuan" and MID (Num2chi, 1, 1) <> "Wan" and MID (Num2chi, 1, 1) <> "" "THEN

IF MID (Num2chi, 1, 1) <> "zero" lifenum2chi = "zero" & num2chi

END IF

END IF

END IF

K = K 1

Next i

END IF

IF Right (TRIM (Num2chi), 1) <> "points" then

Num2chi = Num2chi & "All"

END IF

END FUNCTION

转载请注明原文地址:https://www.9cbs.com/read-123100.html

New Post(0)