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

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -