Repository navigation
feat(module:input-number): accepted numbers with commas - #9256
Merged
Laffery merged 1 commit intoJul 17, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enables the input-number component to correctly handle numbers with commas, aligning its behavior with ANTD.
- Updated the defaultParser function to remove commas before parsing a number.
- Added tests to verify that comma-separated numerical inputs are parsed correctly.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| components/input-number/input-number.component.ts | Updated parser function to strip commas from inputs. |
| components/input-number/input-number.component.spec.ts | Added tests to cover comma-separated number inputs. |
Comments suppressed due to low confidence (1)
components/input-number/input-number.component.ts:534
- Consider updating or adding a comment for the defaultParser function to document the new behavior of removing commas from the input string.
return +value.trim().replace(/,/g, '').replace(/。/g, '.');
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #9256 +/- ##
=======================================
Coverage 92.06% 92.07%
=======================================
Files 560 561 +1
Lines 19621 19610 -11
Branches 3098 3102 +4
=======================================
- Hits 18064 18055 -9
+ Misses 1218 1215 -3
- Partials 339 340 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Laffery
reviewed
Jun 27, 2025
HyperLife1119
marked this pull request as draft
June 30, 2025 01:21
HyperLife1119
force-pushed
the
feat/input-number-with-commas
branch
2 times, most recently
from
July 7, 2025 03:31
55147de to
44caf16
Compare
HyperLife1119
force-pushed
the
feat/input-number-with-commas
branch
from
July 7, 2025 03:32
44caf16 to
69ab3e1
Compare
HyperLife1119
marked this pull request as ready for review
July 7, 2025 03:44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
input-number should accept numbers with commas, consistent with antd's behavior.
Does this PR introduce a breaking change?
Other information