java - Display only 2 digits after decimal -
bill[p][l][0] = new decimalformat("##.##").format(double.parsedouble(i2[m][0]));
the code entered above not working; input 10.0
gives 10
output.
it working - # means digit printed if it's relevant (see documentation). try using
bill[p][l][0] = new decimalformat("##.00").format(double.parsedouble(i2[m][0]));
Comments
Post a Comment