Solved

Number formatting

Posted on 2004-09-09
7
231 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

Question has a verified solution.

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

Suggested Solutions

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …

756 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