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

Slider Floating point decimal precision(滑块碰到浮点数小数会有精度问题) #751

Closed
fengT-T opened this issue Aug 1, 2021 · 2 comments · Fixed by #750
Closed
Labels
bug Something isn't working

Comments

@fengT-T
Copy link
Contributor

fengT-T commented Aug 1, 2021

TuSimple/naive-ui version (版本)

2.15.11

Vue version (Vue 版本)

3.2.0-beta.7

Browser and its version (浏览器及其版本)

Chrome(92.0.4515.107)

System and its version (系统及其版本)

Arch Linux x86_64

Node version (Node 版本)

Reappearance link (重现链接)

https://codesandbox.io/s/slider-float-number-precision-bug-q795g?file=/src/Demo.vue

Reappearance steps (重现步骤)

set slider props :step="0.1" :min="0.1" :max="2" and Set the value to 0.7. or 1.2

slider组件参数为 :step="0.1" :min="0.1" :max="2" ,然后去设置滑块的值为0.7 或者 1.2

Expected results (期望的结果)

0.7 or 1.2

Actual results (实际的结果)

0.7000000000000001 1.2000000000000002
2021-08-01 21-07-12屏幕截图

Remarks (补充说明)

pull requests #750

@github-actions github-actions bot added the untriaged need to sort label Aug 1, 2021
@Talljack Talljack added bug Something isn't working and removed untriaged need to sort labels Aug 2, 2021
@trylovetom
Copy link

@07akioni same issue with input-number

step 0.01

截圖 2021-08-26 上午2 12 00

@07akioni
Copy link
Collaborator

@07akioni same issue with input-number

step 0.01

截圖 2021-08-26 上午2 12 00

Please open an issue for input number

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants