Format the given number to nearest 10
n (rounded to thousands), immediately suffixed (without space)
with metric unit (k, M, G, T, P or E), rounding half up with a precision of 3 digits, whereafter
trailing zeroes in fraction part are stripped. Numbers lower than thousand are not affected.
For example (with English locale):
- 999.999 will appear as 999.999
- 1000 will appear as 1k
- 1004 will appear as 1k
- 1005 will appear as 1.01k
- 1594 will appear as 1.59k
- 1595 will appear as 1.6k
- 9000 will appear as 9k
- 9900 will appear as 9.9k
- 9994 will appear as 9.99k
- 9995 will appear as 10k
- 99990 will appear as 100k
- 9994999 will appear as 9.99M
- 9995000 will appear as 10M
The format locale will be set to the one as obtained by
Faces#getLocale()
.
If the value is
null
,
NaN
or infinity, then this will return
null
.