Recommended: How to limit the method that can only be entered in Chinese. function isCharsInBag (s, bag) { var i,c; for (i = 0; i s.length; i++) { c = s.charAt(i);//The character in the string s if (bag.indexOf(c) -1) return c; } return ; } Check function: function ischinese(s) { var errorChar; var badChar = ABCDEFGHIJKLMNOPQRST
Function AtoC(a As Currency) As String'Note: This function is suitable for currency conversions below trillions of dollars, allowing the value of A to be at most two decimal places
'Define two strings, where Chinese characters and numbers are calculated as one
Dim String1 As String 'as defined below
Dim String2 As String 'as defined below
Dim String3 As String 'Value taken from the original A value
Dim I As Integer 'loop variables
Dim J As Integer 'A's value multiplied by 100's string length
Dim Ch1 As String 'Chinese reading of numbers
Dim Ch2 As String 'Chinese character pronunciation of numeric bits
Dim nZero As Integer 'How many consecutive non-zero numbers are used to calculate
String1 = 01234444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444
String2 = 10,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000
'MsgBox CStr(a * 100)
If InStr(1, CStr(a * 100), .) <> 0 Then
err.Raise 5000, , This function (AtoC()) can only convert numbers within two digits after the decimal point!
End If
J = Len(CStr(a * 100))
String2 = Right(String2, J) 'Take out the value of STRING2 of the corresponding number of digits
For I = 1 To J
String3 = Mid(a * 100, I, 1) 'Take out the value of a certain bit to be converted
If String3 <> 0 Then
Ch1 = Mid(String1, Val(String3) + 1, 1)
Ch2 = Mid(String2, I, 1)
nZero = nZero + 1 ' means that the base is not zero
Else
Share: 15 very useful examples in ASP programming (II) 8. Force password input dialog box to put this sentence on the beginning of the page % response.status=401 not Authorized response.end % 9 How to pass variable from one page to another Answer Use HIDDEN type to pass variable % form method=post action=mynextpage.asp % for each item in request.form % input
2 pages in total Previous page 12 Next page