Solved

Number formatting

Posted on 2004-09-09
7
230 Views
Last Modified: 2010-03-31
Hi,
   What's the best way to format a number for currency? The value 1.80 for example would be stored in a float as 1.8  

   What's the best way to do this? :)


Thanks,

Pete

0
Comment
Question by:petepalmer
  • 4
  • 2
7 Comments
 
LVL 6

Accepted Solution

by:
expertmb earned 100 total points
ID: 12016310
0
 

Assisted Solution

by:Al-Khwarizmi
Al-Khwarizmi earned 100 total points
ID: 12016339
NumberFormat.getCurrencyInstance().format ( myNumber );
0
 
LVL 6

Expert Comment

by:expertmb
ID: 12016366
Al-Khwarizmi,
the link has same piece of code :)
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Expert Comment

by:Al-Khwarizmi
ID: 12016474
I know, but I didn't see your comment when I posted mine, as I took a while to test the code. :/
Isn't there any way to delete comments?
0
 
LVL 6

Expert Comment

by:expertmb
ID: 12016504
>>I know, but I didn't see your comment when I posted mine, as I took a while to test the code. :/
it happens. it happened many times to me also. no problem :-)

>>Isn't there any way to delete comments?
venabili might help in this regards.

0
 
LVL 1

Author Comment

by:petepalmer
ID: 12016530
Only fair that you both win. One gave me some examples, the other took the time to test it - so I doubled the points and halved them between you :)

Cheers for your help!
0
 
LVL 6

Expert Comment

by:expertmb
ID: 12016543
:-)
cheers to ALL !!!

mb...
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Opening PDF on button click and fill new document 2 47
Adding multiple JVM environments to RedHat 6 7 47
CSV file parsing thru Java 13 34
Is there a simpler dropbox system? 10 34
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This video teaches viewers about errors in exception handling.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question