0

Possible Duplicate:
Rounding a double to 5 decimal places in Java ME

i have a double value which is 2.8. I was planning to display on screen in the form of 2.80. Is there any idea how to do it? thanks=)

Community
  • 1
  • 1

1 Answers1

0

The DecimalFormat class, in Java SE, can handle this scenario. Unfortunately, Java ME doesn't have it or anything similar to it.
I think the solution is to convert the double value to string and add the extra '0' at the end.

String formattedValue = Double.toString(value).concat("0");
yoninja
  • 1,952
  • 2
  • 31
  • 39