Skip to content
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

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

Open
1 task done
MagicWang opened this issue Oct 24, 2024 · 0 comments
Open
1 task done

Comments

@MagicWang
Copy link

MagicWang commented Oct 24, 2024

  • 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,还是希望直接使用官方组件就能做到。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant