Solved

Number formatting

Posted on 2004-09-09
7
229 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
groupNoAdj 7 97
how to see all occupied ports on windows 10 laptop 15 66
maven module vs maven project 3 23
Crystal Reports Licensing Questions 4 13
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…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…

832 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