This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes argh.. i hate memory lapses.  help with converting numbers to currency Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "argh.. i hate memory lapses.  help with converting numbers to currency" Watch "argh.. i hate memory lapses.  help with converting numbers to currency" New topic
Author

argh.. i hate memory lapses. help with converting numbers to currency

Zhuge Liang
Greenhorn

Joined: Nov 24, 2003
Posts: 3
mkay.. im tryin to convert a 'dollar amount' into a currency like output and i just cant remember for the life of me how to do it. help. kthx
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24189
    
  34

Use "new java.text.DecimalFormat("#.##")" .


[Jess in Action][AskingGoodQuestions]
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
And in case you don't have the memory of Ernest to remember so many details of the Java API, you might do well to remember the location of the J2SE API documentation.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
jQuery in Action, 2nd edition
 
subject: argh.. i hate memory lapses. help with converting numbers to currency