Renminbi lowercase amount converted to uppercase functions

xiaoxiao2021-03-06  53

code:

<% Function Money (THENUMBER)

DIM MONEY, I, STRING1, STRING2, Length, Checkp 'Define Variables

DIM One (), onStr () 'Definition array

String1 = "Zero Zibo 叁 伍 柒捌"

String2 = "Wan Yiyi picks up hundreds of millions of 佰 万 万 佰 佰 元 分 分"

Checkp = INSTR (THENUMBER, ".") 'Judging whether there is a decimal place

IF CHECKP <> 0 THEN

Thenumber = replace (teller, "," ") 'removes the decimal place

END IF

Length = len (theenumber) 'acquired data length

Redim One (Length-1) 'redefines the array size

Redim OneStr (Length-1) 'redefines the array size

For i = 0 to Length-1

One (i) = MID (THENUMBER, I 1, 1) 'loops gets the number of each bit

One (i) = MID (String1, One (i) 1, 1) 'cycle acquisition of digital correspondence

if Checkp = 0 THEN

'Does not contain a decimal data corresponding to the unit

OneStr (I) = MID (String2, 14-Length i, 1)

Else

'The unit corresponding to the decimal data

OnStr (I) = MID (String2, 15-Length i Len (THENUMBER) -Checkp, 1)

END IF

One (i) = One (i) & onStr (i) 'combines numbers and units

NEXT

Money = Replace (Join (One), "", "") 'acquires all the elements in the array and connects

Money = Replace (Money, "Zero Yuan", "Yuan")

Money = Replace (Money, "万", "10,000")

Money = Replace (Money, "亿", "100 million")

Money = Replace (Money, "Zero", "Zero")

Money = Replace (Money, "Zero", "Zero")

Money = Replace (Money, Zero Pick "," Zero ")

Do While Not Instr (Money, "Zero Zero") = 0

Money = Replace (Money, Zero Zero "," Zero ")

loop

Response.write Money 'display result

END FUNCTION

%>

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

New Post(0)