This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to convert numbers to words in java?

 
Veronica Martinez
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Example:
2 000 000
Output:
Two Million

The range of numbers to be converted is up to 2 million.
Thank you so much. )
 
Steve Luke
Bartender
Posts: 4181
21
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We typically won't write programs for you because we are NotACodeMill. Instead, we answer questions you might have about getting it done yourself. So please ShowSomeEffort: What code do you currently have and where are you getting stuck?
 
Randall Twede
Ranch Hand
Posts: 4398
3
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i'm glad i don't have to write a program to do that
 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If this isn't a homework question, then the best way to do it is to search the Internet for code which already does it. I'm sure such code exists. So, is it a homework question? (It's perfectly okay to discuss homework questions here, but like Steve said, don't expect to be given the answer.)
 
fred rosenberger
lowercase baba
Bartender
Posts: 12124
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is also very similar to one of our CattleDrive problems. You may be able to search our forums and find some hints already here.
 
Winston Gutkowski
Bartender
Pie
Posts: 10417
63
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Veronica Martinez wrote:The range of numbers to be converted is up to 2 million.

It's actually quite a fun problem to solve; though how useful it is, I'm not sure.

Winston
 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Winston Gutkowski wrote:It's actually quite a fun problem to solve; though how useful it is, I'm not sure.

Winston


Some of us still live in a world where payments are made with pieces of processed dead tree material called, variously, "cheques" or "checks". Many of them are produced by computers these days, but they still have to have the payment amounts printed on them in words as well as numbers.
 
Winston Gutkowski
Bartender
Pie
Posts: 10417
63
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:Some of us still live in a world where payments are made with pieces of processed dead tree material called, variously, "cheques" or "checks". Many of them are produced by computers these days, but they still have to have the payment amounts printed on them in words as well as numbers.

Which seems almost absurdly redundant in this day and age, since the whole reason for writing out the amount in the first place was to make sure that the puny human writing the cheque didn't make a mistake. But I take your point.

Winston
 
Campbell Ritchie
Sheriff
Pie
Posts: 48954
60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But a human has to read the cheque and copy the numbers onto a screen.
 
Winston Gutkowski
Bartender
Pie
Posts: 10417
63
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:But a human has to read the cheque and copy the numbers onto a screen.

Not since MICR (first tested in 1959) they don't.

Winston
 
fred rosenberger
lowercase baba
Bartender
Posts: 12124
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deadly Byte,
Your post was moved to a new topic.
 
Frances Hollis
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Winston Gutkowski wrote:
Campbell Ritchie wrote:But a human has to read the cheque and copy the numbers onto a screen.

Not since MICR (first tested in 1959) they don't.

Actually, the preprinted MICR is only the bank and account information. The amount still must be read by a human (or OCR, which is hit or miss).

Ann
 
Anna Harris
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't provide you the whole program for that conversion. Try to write a conversion program for that if any problem arises then we will help you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic