ThousandSeparator with leading zeros
See original GitHub issueThe thousandSeparator is also added if your number starts with leading zeros. Consider the following (standard) configuration:
<NumberFormat thousandSeparator="," decimalSeparator="." />
When you enter 0123
it will be displayed as 0,123
The problem that arises with this is that we have some users who want to enter a decimal point as a comma (,
). So you type:
0
: The field now shows0
,
: The field still shows0
1
: The field shows01
2
: The field shows012
3
: The field now shows0,123
If you don’t pay close attention, you get the feeling that you correctly entered 0.123
. Only after the next blur event, you will see that you actually entered 123
.
So the question is: Would it be possible to only append the thousandSeparator in places where the value is actually bigger than a thousand, discounting leading zeros?
That would mean that 0123
would be displayed as 0123
rather than 0,123
.
Frankly, it seems to work for numbers with more than 4 characters, as 01234
is correctly displayed as 01,234
.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top GitHub Comments
In npm it was already there. Added it on releases as well.
Agree, The thousand separator should ignore leading zeros. Will fix this.