0

I'm having a list of Integer from 1 to 100. If I loop through the list, I wanted to make the output as,

"One"

"Two" .....

"Hundred"

Is there any direct method in Java to obtain the above output?

Vijin Paulraj
  • 4,291
  • 4
  • 37
  • 52
  • I don't think there's any built-in method to translate integers to English words. – Gal Aug 12 '13 at 11:30

3 Answers3

2

No such method or class has been provided by JDK.

You can use the code mentioned here or here for reference purpose.

saurav
  • 3,293
  • 1
  • 21
  • 33
0

switch case are used to meet that requirement: Here is source code. Answer of this question described here: How to convert number to words in java

Officially this is not possible or no standard library available by native Java.

Don't duplicate.

Community
  • 1
  • 1
Ashwani
  • 3,387
  • 1
  • 23
  • 30
0

There is none in the official Java libraries. However, the International Components for Unicode project has a RuleBasedNumberFormat with those capabilities. It even has a SPELLOUT constant.

Eric Jablow
  • 7,739
  • 2
  • 21
  • 29