1833847 Members
2113 Online
110063 Solutions
New Discussion

Numbers to words???

 
SOLVED
Go to solution
Greg White
Frequent Advisor

Numbers to words???

Hi everyone,


Does anyone know of a utility that will convert amounts to the spelled out form? For example, 1234.56 to "One thousand thirty-four and 56/100 "?. I obviously need this for a check writing script.

Thanks in advance, Greg
I know how to do it in pascal.
4 REPLIES 4
A. Clay Stephenson
Acclaimed Contributor

Re: Numbers to words???

Hi Greg:

I remember doing this for someone a few months ago. I provided a C example and also a Perl script that would do just this operation. If you are not a Perl type guy, I could probably spend about two minutes yanking the sunroutine out and driving it with command line arguments.
Anyway, search the Forums for 'english_numbers' and I'm sure you will find the thread. Others may have already looked this up but I don't (or almost never) do searches. I leave that to you.

Regards, Clay


If it ain't broke, I can fix that.
Patrick Wallek
Honored Contributor
Solution

Re: Numbers to words???

A. Clay Stephenson
Acclaimed Contributor

Re: Numbers to words???

Hi Greg:

I spent a couple of minutes adding a command line parser. It also deals with the problem of supplying amounts with commas.
e.g. 1,234.56 won't kill it because it strips the commas before outputting. Here's the drill:
english.pl 1,234.56 output "One thousand thirty-four and 56/100". One input argument - one output argument BUT if you supply it with mulltiplr ags you get your argument and the words on one line and the next pair on the next lines.

Enjoy, Clay
If it ain't broke, I can fix that.
Greg White
Frequent Advisor

Re: Numbers to words???

Thanks guys! This was just what I needed and I even saw how to put the commas in the numbers. I love this place.

Thank you, Greg
I know how to do it in pascal.