...

View Full Version : Can any one help me Pleaseeeee!



steve sea
12-17-2007, 08:50 PM
Hi everyone

I wonder if any one can help me, I've been searching the net for a javascript script, which when you type in any figure it will return that figure in written words.

For example: 200.10 returns two hundred dollars and ten cents,

and : 1.1 = one dollar and one cent (note single and plural dollar/dollars and cent/cents)

I've found scripts in PHP & VB but as I know less about these then javascript, can I convert these to javascript (easy) ?

I don't know where to start, I'm not that great with javascript but could modify and change a working script to fit my bill.


Many Thanks for any help.

Steve.

Philip M
12-18-2007, 08:42 AM
Google would have brought up:-

http://javascript.about.com/library/bltoword.htm

Do please read the posting guidelines regarding silly thread titles. The thread title is supposed to help people who have a similar problem in future. Yours is useless for this purpose. And many people are put off if you appear to grovel.

steve sea
12-18-2007, 01:45 PM
Sorry about the title, and sorry for groveling about being sorry for the title,

The link you kindly suppled I have been playing with for some time and have tried to add dollars cents etc. but with out success.

steve

Philip M
12-18-2007, 03:53 PM
You said "I don't know where to start, I'm not that great with javascript but could modify and change a working script to fit my bill."

The script is quite a complicated one, but you can modify it by setting a flag to indicate dollar, dollars, cent or cents. Then print the appropriate word.

Look for
str += 'point ';
This needs to be something like:-
str +='dollar(s)' if there are any cents
and add str += 'cent(s)' at the end of the string, or if 0 cents then str += 'dollar(s)'

steve sea
12-19-2007, 07:16 PM
Thank Philip

Will have a play around with it between being forced Xmas shopping :(

why do people always say it only once a year as if its only one inconvenience :confused:

Steve



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum