Return the number in text format

advertisements

Possible Duplicate:
How can I convert an integer into its verbal representation?

I am looking for some solution to return a number as text.

By that I mean that 100 should be returned as 'one hundred'

It is more or less just a tidious task to make such a function myself, but I rather not re-invent the wheel, and this can't be the first time someones has requested this.

Unfortunatly my search so far has not turned up anything, so here I try stackowerflow.

Basically the numbers comes from a database, so if there is some smart methods you could use here it would be pretty nice.

As mentioned, a small function that returns eg. 100 as 'one hundred' is not a complicated task, but what if you need to take language considarations into the solution?

Has anybody come accross something that actually can do this, and perhaps in multiple languages?


Yes you can use this:

Java numbers to text

Basically the idea is to form the numbers by simply defining all the digits and the tenths, and after that you can also the define the hundreds, the thousands and so on. Because numbers in English are always formed the same way, this is very easy for the English language.