string formatting - GWT NumberFormat problems with high precision decimals -
I am using GWT 2.0 and when I try to use NumberFormat to double format the result Not expected:
number format = number format.get format ("########"); Double D = new double ("0.256281093911"); Format.format (d); Formatted string: 0.02147484 As you can see that the formatted value is wrong (this can be seen in GVT showcase). Is it related to some custom format I am using (#. ########)? Or is it a bug in the GWT formatter? If this is a bug, then has anyone got an alternative solution? Thank you.
You can try NumberFormat.getDecimalFormat. Also, there can be anything in between your browser locale and / or decimal decimals.
Comments
Post a Comment