Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Converting numbers to word

 
namrata mahajan
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hii guys,
i am new to this forum. Can anybody give me an idea about how to convert a number into word e.g. if a number is 7932 then in word it will be seven thousand nine hundred and thirty two.
THANKS IN ADVANCE
 
Ankit Garg
Sheriff
Posts: 9528
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well I don't think there is no direct way to do this. You will have to write a small program that uses % 10 to extract the last digit, then according to the position of the digit, add hundred or thousand and then divide the number by 10 and then again uses %10.

This question is not related to SCJP so post it in the Java-General-beginner forum
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic