Solved

Number formatting

Posted on 2004-09-09
7
232 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
Technology Partners: 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to convert from xls to xlsx using java 7 159
Convert from a json string array to a Java object 3 80
Html Table Looping (part 2) 5 41
Tagging and Merging on Branch 1 68
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
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 tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

739 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