Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

urgently asp code for converting numeric values into words

Status
Not open for further replies.

bestsupport

Programmer
Jan 1, 2003
2
0
0
AE
urgently required asp code for converting numeric values into words


to print the numeric values from the database onto cheque after converting them into words

for example:
numeric value is :100
then print it in words like :
One Hundred



Thanking you in advance
 
You will probably need to write this one yourself, as far as I know there isn't a built in function for it. The easiest way will most likely be to create a function that accepts a number and returns the words. Create an array that holds 1 through 19 in string format:
Dim baseNumbers(19)
myArray(1) = "One"
myArray(2) = "Two"
etc.

Create one for 10's group:
Dim Tens(10)
Tens(2) = "twenty"
Tens(3) = "thirty"
etc

Now parse the number, start with the highest set (1000000) and work your way down, each time dividing and if > 0 convert that portion to words and subtract it from the starting number.

-Tarwn ________________________________________________________________________________
Want to get great answers to your Tek-Tips questions? Have a look at faq333-2924
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top