Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<%
Option Explicit
Dim words(33,1)
words(1,0) = 1
words(1,1) = "One "
words(2,0) = 2
words(2,1) = "Two "
words(3,0) = 3
words(3,1) = "Three "
words(4,0) = 4
words(4,1) = "Four "
words(5,0) = 5
words(5,1) = "Five "
words(6,0) = 6
words(6,1) = "Six "
words(7,0) = 7
words(7,1) = "Seven "
words(8,0) = 8
words(8,1) = "Eight "
words(9,0) = 9
words(9,1) = "Nine "
words(10,0) = 10
words(10,1) = "Ten "
words(11,0) = 11
words(11,1) = "Eleven "
words(12,0) = 12
words(12,1) = "Twelve "
words(13,0) = 13
words(13,1) = "Thirteen "
words(14,0) = 14
words(14,1) = "Fourteen "
words(15,0) = 15
words(15,1) = "Fifteen "
words(16,0) = 16
words(16,1) = "Sixteen "
words(17,0) = 17
words(17,1) = "Seventeen "
words(18,0) = 18
words(18,1) = "Eighteen "
words(19,0) = 19
words(19,1) = "Nineteen "
words(20,0) = 20
words(20,1) = "Twenty "
words(21,0) = 30
words(21,1) = "Thirty "
words(22,0) = 40
words(22,1) = "Forty "
words(23,0) = 50
words(23,1) = "Fifty "
words(24,0) = 60
words(24,1) = "Sixty "
words(25,0) = 70
words(25,1) = "Seventy "
words(26,0) = 80
words(26,1) = "Eighty "
words(27,0) = 90
words(27,1) = "Ninety "
words(28,0) = 100
words(28,1) = "Hundred "
words(29,0) = 1000
words(29,1) = "Thousand "
words(30,0) = 1000000
words(30,1) = "Million "
words(31,0) = 1000000000
words(31,1) = "Billion "
'function to convert numbers to words
Function cWord(num)
Dim leftToProcess, wrkngWord, i
If num = 0 Then
cWord = ""
Exit Function
End If
leftToProcess = cDbl(num)
For i = 31 to 1 step -1
If leftToProcess/cLng(words(i,0)) >= 1 Then
If i >= 28 Then
wrkngWord = wrkngWord & cWord(Fix(leftToProcess/cLng(words(i,0)))) & words(i,1)
Else
wrkngWord = wrkngWord & words(i,1)
End If
leftToProcess = leftToProcess - (Fix(leftToProcess/cLng(words(i,0))) * cLng(words(i,0)))
End If
If leftToProcess < 1 And leftToProcess > 0 Then
cWord = wrkngWord
Exit For
End If
Next
cWord = wrkngWord
End Function
If Request.Form("txtNumber") <> "" Then
If isNumeric(Request.Form("txtNumber")) Then
Response.Write Request.Form("txtNumber") & " Converts To " & cWord(Request.Form("txtNumber"))
Else
Response.Write Request.Form("txtNumber") & " is not a number"
End If
End If
%>
<form method="POST" action="money.asp">
Enter a Number: <input type="text" name="txtNumber">
<input type="submit">
</form>