Skip to content

a-input-number组件string-mode下,precision为2,当value是整数时,后面没有补0 #7889

@MagicWang

Description

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

Version

4.2.5

Environment

win10,chrome,vue3.2.45

Reproduction link

Edit on CodeSandbox

Steps to reproduce

1、input-number组件,设置string-mode
2、设置精度precision为2
3、输入一个整数5

What is expected?

希望input-number绑定的值为'5.00'

What is actually happening?

实际上值为'5'


在我们这个交易系统里,后端货币金额用字符串存储的,要求精确到小数点后两位,如果刚好是整数时input-number绑定的值后面没有补0,造成数据不一致,展示的时候不好看。目前我基于input-number自己扩展了一个组件去补0,还是希望直接使用官方组件就能做到。

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