<% Function money (thenumber) Dim money, I, string1, string2, length, checkp 'defines the variable Dim one (), onestr () 'defines an arrayString1 = "" String2 = "tens of thousands of yuan for hundreds of millions of yuan and tens of thousands of yuan for each cent" Checkp = instr (thenumber, ".")' If checkp <> 0 then Thenumber = Replace (thenumber, ".", "") 'remove decimal places End if Length = Len (thenumber) 'Get the 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 +) 'returns the number of each digit in a loop. One (I) = mid (string1, one (I) +) 'returns the upper case of the number in a loop. If checkp = 0 then 'The unit of the number corresponding to the decimal data Onestr (I) = mid (string2, 14-Length + I, 1) Else 'UNIT of the number corresponding to the decimal data Onestr (I) = mid (string2, 15-Length + I + Len (thenumber)-checkp, 1) End if
One (I) = one (I) & onestr (I) 'combines numbers and units Next
Money = Replace (join (one), "", "") 'gets all elements in the array and connects them. Money = Replace (money, "0 RMB", "RMB ") Money = Replace (money, "0 thousand ") Money = Replace (money, "0 billion ") Money = Replace (money, "zero reward", "zero ") Money = Replace (money, "zero reward", "zero ") Money = Replace (money, "zero pick", "zero ") Do while not instr (money, "zero") = 0 Money = Replace (money, "zero", "zero ") Loop Response. Write money' display result End Function %> |