| Author |
Converting Number to Word
|
Ankita Jha
Ranch Hand
Joined: Sep 15, 2008
Posts: 55
|
|
Hello ranchers,
In my application i a need which will convert number to Word.
Problem is ,When i have whole number like (10000 or 2260) etc,it works properly.
Byt i have some number like 158.32 then it shld be read as "One hunderd fifty eight and thirty two paise" but it read the number as "Fifteen thousand eight hundred and thirty two"
Im pasting my code below.Any help wil be appreciated.Thanks in advance.
>
|
 |
Swastik Dey
Ranch Hand
Joined: Jan 08, 2009
Posts: 1195
|
|
One problem in your code what I could notice is in
I have not went through your entire code but probably calling the convertNumber function twice might solve your requirement
|
Swastik
|
 |
Ankita Jha
Ranch Hand
Joined: Sep 15, 2008
Posts: 55
|
|
Thanks Swastik Dey
Got it working
|
 |
salvin francis
Ranch Hand
Joined: Jan 12, 2009
Posts: 915
|
|
program can be made much more simpler:
eg:
so units[4] would return "Four", I dont see why you require so many switch cases etc.
|
My Website: [Salvin.in] Cool your mind:[Salvin.in/painting] My Sally:[Salvin.in/sally]
|
 |
 |
|
|
subject: Converting Number to Word
|
|
|