Program that implements monetary amount Chinese big write conversion

zhaozj2021-02-16  56

Today, I found the code for the previously written currency amount (converted more than one billion billions of currency below the currency), and shared:

Function daxie (money As String) As String 'Dim x As String, y As StringConst zimu = ".sbqwsbqysbqwsbq"' define the location code Const letter = "0123456789sbqwy.zjf" 'defined Chinese abbreviations Const upcase = "Zero One II Triple store Wu Lu Wei, trillion round integrity, "Defining uppercase Chinese characters DIM TEMP AS STRINGTEMP = MoneyIF INSTR (TEMP,". ")> 0 THEN TEMP = Left (Temp, INSTR (Temp,") - 1)

If LEN (TEMP)> 16 THEN MSGBOX "The number is too big, it is impossible to convert! Please enter a number of billion billions of numbers", 64, "Error Tips": exit function 'can only convert a currency below billion billions of money!

X = format (Money, "0.00") 'Format Currency Y = "" for i = 1 to LEN (X) - 3Y = Y & MID (X, I, 1) & MID (Zimu, Len (x) - 2 - I, 1) NextIF Right (x, 3) = ".00" Theny = Y & "Z" '*** 元 整 ELSE Y = Y & Left (Right (x, 2), 1) & "J "& Right (x, 1) &" f "'* yuan * angle * points end ify = Replace (Y," 0Q "," 0 ")' Avoid zero thousand (such as: 40200 零 零 零 零) Y = Replace (Y, "0b", "0") 'Avoiding a zero (such as: 41000 壹 壹 千 零) Y = Replace (Y, "0s", "0")' Avoid zero (such as: 204 佰 零 拾)

Do While Y <> Replace (Y, "00", "0") Y = Replace (Y, "00", "0") 'Avoid double zero (such as: 1004 壹 zero zero) LOOPY = Replace (Y "0y", "y") 'Avoid volt (such as: 21 billion 佰 壹 壹 零 零) y = replace (y, "0w", "w")' Avoid 10,000 (eg 2.1 million 10,000) Y = IIF (LEN (X) = 5 and LEFT (Y, 1) = "1) =" 1 ", Right (Y, LEN (Y) - 1), Y) 'Avoid 10 (eg 14 Pick up; 10 壹)) Y = IIF (LEN (X) = 4, Replace (Y, "0.", "), Replace (Y," 0. ",". ")) 'Avoid zero ( Such as: 20.00; 0.12 zero round angle 贰 分 分 分) Function

Private sub fascist3_click () debug.print Daxie ("6218212212309322.3238") 'Return: Lu Yi 佰 壹 捌 捌 捌 仟 佰 壹 仟 佰 佰 佰 圆 壹 壹 壹 壹 佰 佰 佰 佰 佰 壹 佰 佰 佰 壹End Sub

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

New Post(0)