0

Program for Number to string conversion in java

ex: 121 it has to print one hundred and twenty one

28th Mar 2017, 4:32 AM
Hemanth Sans
Hemanth Sans - avatar
4 Antworten
+ 13
Look at the code playground, there are some examples for this.
28th Mar 2017, 4:40 AM
Tashi N
Tashi N - avatar
+ 2
Use String.format() function Example float number = 95.564f; System.out.println(String.format ("%.1f", number)); System.out.println(String.format ("%.2f", number)); System.out.println(String.format ("%.4f", number)); Output 95.6 95.56 95.5640
28th Mar 2017, 4:49 AM
देवेंद्र महाजन (Devender)
देवेंद्र महाजन (Devender) - avatar
+ 2
Sorry my fault, haven't seen the description.
28th Mar 2017, 4:55 AM
देवेंद्र महाजन (Devender)
देवेंद्र महाजन (Devender) - avatar
+ 1
thanks for your advice guys..
28th Mar 2017, 4:57 AM
Hemanth Sans
Hemanth Sans - avatar