• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do i round a double to two decimal places?

 
John Lockheart
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've tried a couple of math formula's, and using java.text.decimalformatter buut, I'm not having much luck. I need something that not only works for decimals with a large amount of numbers after the decimal point. But also something that works for converting an int 30, to double 30.0 and than gives me 30.00...if possible. Is it?
 
Kaydell Leavitt
Ranch Hand
Posts: 689
Eclipse IDE Firefox Browser Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

[ February 27, 2008: Message edited by: Kaydell Leavitt ]
 
John Lockheart
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Works great, thanks a lot.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic