fix: should process 0 correctly when precision is 0
Fix the issue reported by: https://github.com/ant-design/ant-design/issues/33084#issuecomment-1001577639
This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.
🔍 Inspect: https://vercel.com/react-component/input-number/Grq5ac3Jwaze5dK5MnBSaSmmtCxu
✅ Preview: https://input-number-git-fork-boomler-fix-zero-react-component.vercel.app
Codecov Report
Merging #390 (c8d2672) into master (d3de147) will increase coverage by
0.88%. The diff coverage is100.00%.
@@ Coverage Diff @@
## master #390 +/- ##
==========================================
+ Coverage 97.76% 98.65% +0.88%
==========================================
Files 9 9
Lines 448 445 -3
Branches 116 116
==========================================
+ Hits 438 439 +1
+ Misses 10 6 -4
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/InputNumber.tsx | 98.40% <100.00%> (ø) |
|
| src/utils/MiniDecimal.ts | 99.26% <100.00%> (+2.86%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update d3de147...c8d2672. Read the comment docs.
Hi @zombieJ . This pr is to solve a bug caused by https://github.com/react-component/input-number/pull/385. I think this bug is quit easy to happen, so let's see whether this is a good solution or you have other suggestions.