• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to convert numbers to words in java?

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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. )
 
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 4716
9
Scala Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i'm glad i don't have to write a program to do that
 
Marshal
Posts: 28263
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.)
 
lowercase baba
Posts: 13091
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Marshal
Posts: 28263
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Marshal
Posts: 79475
379
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But a human has to read the cheque and copy the numbers onto a screen.
 
Winston Gutkowski
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 13091
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Deadly Byte,
Your post was moved to a new topic.
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic