ant-design-vue icon indicating copy to clipboard operation
ant-design-vue copied to clipboard

The formatter parser attribute is added to the input number, and the precision retains the decimal place invalid problem

Open adelechen708 opened this issue 3 years ago • 2 comments
trafficstars

  • [ ] I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.2.11

Environment

Vue:3.2.13

Reproduction link

Edit on CodeSandbox

Steps to reproduce

inputNumer 设置 formatter="value => $ ${value}.replace(/\B(?=(\d{3}) (?!\d))/g, ',')" parser="value => value.replace(/$\s?|(,*)/g, '')" precision="2" 输入值之后离开,如果为整数时不会保留对应设置小数位

What is expected?

输入 99999 能转成 999,99.00

What is actually happening?

输入 99999 输出了 999,99

adelechen708 avatar Aug 26 '22 07:08 adelechen708

@tangjinzhou 大佬 帮忙看看

wxwebfeng avatar Aug 26 '22 08:08 wxwebfeng

正则有问题吧

tangjinzhou avatar Sep 01 '22 08:09 tangjinzhou

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

github-actions[bot] avatar Nov 01 '22 03:11 github-actions[bot]

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Nov 10 '23 00:11 github-actions[bot]