• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Converting Number to Word  RSS feed

 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
>
 
Rancher
Posts: 1878
15
Android Eclipse IDE Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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


 
Ankita Jha
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Swastik Dey
Got it working
 
Bartender
Posts: 1876
46
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!