[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3081
  • Last Modified:

round up a double to two decimal places

Is there a way to round to the hundreds spot in a double?  I am adding nickels dimes and quarters and sometimes I get some screwy number, I need to display this in a total window (text field) as money is deposited/deducted but I don't see an easy way to do this, I was just hopnig I missed it.

Thanks
0
urobins
Asked:
urobins
  • 2
  • 2
1 Solution
 
objectsCommented:
Use a DecimalFormat when displaying it:

http://www.objects.com.au/java/qa/1647357140.html
0
 
urobinsAuthor Commented:
What library do I need to use to do this?
0
 
objectsCommented:
java.text
0
 
urobinsAuthor Commented:
Thanks I just found it :)

once again you have answered my question with ease... I really appreciate it!
0

Featured Post

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!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now