aspose file tools*
The moose likes Java in General and the fly likes Integer to word for the number Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Integer to word for the number" Watch "Integer to word for the number" New topic
Author

Integer to word for the number

Angel Dobbs-Sciortino
Ranch Hand

Joined: Sep 10, 2003
Posts: 101
Is there a class in the API that will convert an integer into the word for that number? Such as one, two, three, etc.
Angel
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1871
Hi Angel
Not that I know of in Java API.
Can't you just write your own class if you just have single digit numbers to manipulate? If you have 123 and you want to have "one hundred and twenty three" then its little difficult I guess but if you have one digit numbers then you can just define mapping right?
Regards
Maulin
Ransika deSilva
Ranch Hand

Joined: Feb 18, 2003
Posts: 524
Hello ,
I wrote a method which does exactly what you want to do in a calculator assignment for my degree. At the moment I don't have it the at the place I am writting this anser. But if you want I will defenetely give you the coding when I go home. My coding translates 9 decimal numbers and 3 floating point numbers.


SCJP 1.4, SCMAD 1.0<br />SCWCD, SCBCD (in progress)
Angel Dobbs-Sciortino
Ranch Hand

Joined: Sep 10, 2003
Posts: 101
Yes, I would be interested in seeing that method. I've made my own method for now, but I would like to see another implementation of it.
Angel
 
 
subject: Integer to word for the number
 
Similar Threads
doubt in exceptions
Word Frequency Count
doubt in overloading
"Double" and "double" - what's the difference?
Reseting an Iterator