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,469
  • 5
  • 39
  • 54
  • 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,424
  • 1
  • 22
  • 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,463
  • 1
  • 24
  • 31
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,874
  • 2
  • 22
  • 29