7
I would like to know how to keep the variable double
with 2 houses after the comma. Below I have an example, when transforming a String
in double
if it has values after the point is kept the 2 houses, however if it is only zeros, no.
"10.01" => 10.01
"10.00" => 10.0 //Gostaria do resultado 10.00
You want to format the
double
back to aString
with the correct two decimal places? The internal format of thedouble
is fixed, however, for display issues it is possible to format yes.– Anthony Accioly