The Prime Minister of the People's Republic of China believes that

Source: Internet
Author: User
Program code:
<% Function money (thenumber)
Dim money, I, string1, string2, length, checkp 'defines the variable
Dim one (), onestr () 'defines an array

String1 = ""
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
%>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.