Need Help Rounding
Posted on 2011-09-30
I need help with a rounding problem. I want to take a number and convert it with two decimal places.
For instance, 345.667 would end up being 345.67; and 345 would end up being 345.00.
I have the following:
double number = Marth.round(number * 100.0)/100.0;
This works for most numbers, but when I have a whole number it converts it 345.0 with only one decimal place.