Function RMB (ls as currency) as string dim dx_sz as string dim dx_dw as string dim str_int as string dim str_dec as string dim dx_str as string dim fu as string dim a as string dim b as string dim c as string dim d as string dim B2 AS STRING DIM NUM_INT AS NUMBER DIM NUM_DEC AS CURRENCY DIM LEN_INT AS NUMBER DIM I AS NUMBER DIM A_INT AS NUMBER DIM PP As Number
DX_SZ = "Zero Zibo 伍 柒捌" DX_DW = "Wan Rong picks up hundreds of millions of 佰 佰 万 佰 佰 元" IF LS <0 THEN LS = ABS (LS) FU = "Negative" Else Fu = "" END IF
DX_STR = CSTR (LS) DX_STR = Replace (DX_STR, "¥", ") DX_STR = Replace (DX_STR,", ",") IF (LS> 0) AND (LS <1) Then DX_STR = "0" DX_STR PP = INSTR (DX_STR, ".") IF PP> 0 THEN STR_INT = MID (DX_STR, 1, INSTR (DX_STR, ".") - 1) Else Str_INT = DX_STR END IF
Num_int = tonumber (STR_INT)
IF (ls> 0) and (ls <1) THEN NUM_DEC = LS * 100 else Num_Dec = (LS-NUM_INT) * 100 END IF
STR_DEC = TOTEXT (NUM_DEC) STR_DEC = Replace (Str_Dec, "¥", "")
LEN_INT = LEN (STR_INT) DX_STR = "" for i = 1 to len_int a = MID (STR_INT, I, 1) A_INT = Tonumber (A) B = MID (DX_SZ, (A_INT 1), 1) C = MID ( DX_DW, (13-LEN_INT I), 1) IF DX_STR <> "" THEN D = MID (DX_STR, LEN (DX_STR) -1, 1) ELSE D = "" "end if if if if if if if if if if if if if (b =" zero ") ((D = "zero") or (c = ") or (c =" 10,000 ") or (c =")) THEN B = "" IF (a = "0 ") and (c <>" yuan ") and (c <>" "万") and (c <> "") THEN C = "" IF ((c = "yuan") OR (c = "万" ) OR (C = "100))) and (d =" zero ") and (a =" 0 ") THEN DX_STR = MID (DX_STR, 1, LEN (DX_STR) -2) D = MID (DX_STR, LEN DX_STR) -1, 2) IF ((c = "yuan") AND (D = "10,000")) OR (C = "10,000)) and (d =")) THEN C = "" END IF DX_STR = DX_STR B C B2 = B Next I
The 'Handling amount is less than 1 case if LEN (DX_STR) <= 2 THEN DX_STR = "" IF (Num_DEC <10) THEN A_INT = Tonumber (STR_DEC) B = MID (DX_SZ, (A_INT 1) 1) if Num_Dec = 0 THEN DX_STR = DX_STR "whole" if Num_DEC> 0 THEN DX_STR = DX_STR "zero" b "division" end if if Num_DEC> = 10 THEN A_INT = Tonumber (MID (Str_Dec, 1, 1) ) A = MID (DX_SZ, (A_INT 1), 1) A_INT = Tonumber (MID (Str_DEC, 2, 1)) B = MID (DX_SZ, (A_INT 1), 1) IF a <> "Zero" THEN A = a "angle" IF B <> "zero" THEN B = B "points" else b = "" "DX_STR = DX_STR A B end if if if ls = 0 Then DX_STR =" Zero Yuan "DX_STR = Fu DX_STRDX_STR = Replace (DX_STR, "1.0 million", "100 million") DX_STR = Replace (DX_STR, "万", "10,000") DX_STR = Replace (DX_STR, "Zero Thousand", "Thousand") DX_STR = Replace (DX_STR , "Zero Yuan", "Yuan")
RMB = DX_STREND FUNCTION