4

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?

Community
  • 1
  • 1
Verakso
  • 466
  • 5
  • 16

2 Answers2

1

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.

Oscar Gomez
  • 18,436
  • 13
  • 85
  • 118
  • I was not aware my questions was a duplicate, and there is many other good answers in the other question thread. But for my intermediate purpose, this answer came closest. It contains a fine representation of the solution in English and French. – Verakso Aug 24 '11 at 21:03
0

Something like this (may be not the best one, I just make a draft search)?

http://www.daniweb.com/software-development/csharp/threads/53072

Badiboy
  • 1,519
  • 1
  • 18
  • 31