I am trying to return a double so that it rounds up to the tenths. I have:
roundedTemp = (double)Math.round(tempNum *10)/10;
return roundedTemp;
What am I doing wrong? I get it back to 2 decimal places...
I am trying to return a double so that it rounds up to the tenths. I have:
roundedTemp = (double)Math.round(tempNum *10)/10;
return roundedTemp;
What am I doing wrong? I get it back to 2 decimal places...
Use DecimalFormat.
DecimalFormat df = new DecimalFormat("#.#");