This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Beginning Java and the fly likes Convert decimal number in words Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Convert decimal number in words" Watch "Convert decimal number in words" New topic

Convert decimal number in words

Vijay Chandran
Ranch Hand

Joined: Jan 07, 2007
Posts: 178
Dear friends,

I need an utility Java program that will convert a decimal number to wordings.

For ex.. 120.65 to be converted as one hundred and twenty point sixty five

Kindly provide your help.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14114

Is this a homework question? JavaRanch is not a code mill.

So, what have you tried yourself and where do you get stuck? With assignments like these, it helps to first think about the problem itself - describe in normal language how you would solve this. When you're clear about how you're going to do it, you can start thinking about writing Java code.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11250

This is also very much like the CattleDrive assignment 4a and 4b.

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
John Abong
Ranch Hand

Joined: May 14, 2007
Posts: 79
I second that, Fred.
I agree. Here's the link:
subject: Convert decimal number in words