Skip to content

input number 添加了formatter parser 属性,precision保留小数位失效问题 #5916

@wxwebfeng

Description

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

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions