Skip to content

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

@adelechen708

Description

@adelechen708
  • 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions