wood burning stoves 2.0*
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
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: 1873
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Integer to word for the number