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

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -