-
-
Notifications
You must be signed in to change notification settings - Fork 49.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NumberInput 无法正确格式化以色列等国家的负数值 #28057
Closed
1 task
xuqiang1227 opened this issue
Nov 28, 2020
· 4 comments
· May be fixed by react-component/input-number#279
Closed
1 task
NumberInput 无法正确格式化以色列等国家的负数值 #28057
xuqiang1227 opened this issue
Nov 28, 2020
· 4 comments
· May be fixed by react-component/input-number#279
Comments
formatter 和 parser 完全是开发者自定义的,官方这个例子肯定不能满足所有情况,建议根据自己的需求定制修改。 |
@afc163 偏右,我查了一下代码,这个问题的原因是: 设置了
直接将格式化后的第一个位
|
那只是个demo,或者你可以来PR帮忙改进一下demo |
来个 PR 吧。 |
xuqiang1227
added a commit
to xuqiang1227/input-number
that referenced
this issue
Nov 30, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reproduction link
Steps to reproduce
以色列等国家的负数格式显示为:
-x.xxx.xxx,xxx
也就是千分位分隔符为
.
, 小数点为:,
当输入值为
-88888888888.88
应该格式化为:-88.888.888.888,88
,但实体上显示为:-88,888.888.888,88
格式化正则表达式为:
/\B(?=(\d{3}) (?!\d))/g
What is expected?
当输入值为
-88888888888.88
应该格式化为:-88.888.888.888,88
What is actually happening?
实际上显示的为:
-88,888.888.888,88
The text was updated successfully, but these errors were encountered: