java - Double.toString with two decimals -
i want 2 decimals in code. how can that?
here coding:
double conta1 = ((num1*35)/100)*1.05; bomba1.settext(double.tostring(conta1));
num1=55
well want result 20.21 instead of 20.212500000...
how can that?
try code:
bomba1.settext(new decimalformat("#.##").format(conta1));
Comments
Post a Comment