Reputation: 334
I am using MessageFormat. The current pattern is:
{0,number,#,###.######}
For 0.123456
it gives me
0.123456
which is expected. However I want to group the decimal places so that the display is
0.123 456
I would also like trailing zeros, so for 0.1234
the display would be
0.123 400
I can't seem to find the correct custom pattern for this
Upvotes: 0
Views: 573
Reputation: 131
For the trailing zeros you could replace the #
with 0
in the decimal places like "{0,number,#,###.000000}"
See DecimalFormat#Special Pattern Characters
0 Number Yes Digit
# Number Yes Digit, zero shows as absent
Upvotes: 1