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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -