DecimalFormat rounding

Viewed 31807

Here is small code to illustrate what I am seeing

float floater = 59.999f;

DecimalFormat df = new DecimalFormat("00.0");

System.out.println(df.format(floater));

This prints:

60.0

I would like it to print

59.9

What do I need to do?

2 Answers
Related