-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Add approximatelySign to NumberFormatRangePartTypeRegistry for ES2023 #62013
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
Merged
+204
−8
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
64a51e8
Initial plan
Copilot 5de28db
Add approximatelySign to NumberFormatPartTypeRegistry for ES2023
Copilot 8940466
Apply formatting to es2023.intl.d.ts
Copilot e9ec0f5
Merge main into copilot/fix-61960
Copilot 7810288
Merge main and fix eslint issues in harnessGlobals.ts
Copilot ab5e89f
Revert eslint changes and assign test result to variable
Copilot ad3bf4a
Move approximatelySign to NumberFormatRangePartTypeRegistry
Copilot 2c5e16b
Fix NumberRangeFormatPart to not extend NumberFormatPart
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,10 +25,23 @@ new Intl.NumberFormat('en-GB').formatRange(10n, 1000n); | |
| new Intl.NumberFormat('en-GB').formatRangeToParts(10, 1000)[0]; | ||
| new Intl.NumberFormat('en-GB').formatRangeToParts(10n, 1000n)[0]; | ||
|
|
||
| // Arbitrary-precision string arguments | ||
| new Intl.NumberFormat('en-GB').format('-12.3E-4'); | ||
| new Intl.NumberFormat('en-GB').formatRange('123.4', '567.8'); | ||
| new Intl.NumberFormat('en-GB').formatRangeToParts('123E-4', '567E8'); | ||
| new Intl.NumberFormat('en-GB').format('Infinity'); | ||
| new Intl.NumberFormat('en-GB').format('-Infinity'); | ||
| new Intl.NumberFormat('en-GB').format('+Infinity'); | ||
| // Arbitrary-precision string arguments | ||
| new Intl.NumberFormat('en-GB').format('-12.3E-4'); | ||
| new Intl.NumberFormat('en-GB').formatRange('123.4', '567.8'); | ||
| new Intl.NumberFormat('en-GB').formatRangeToParts('123E-4', '567E8'); | ||
| new Intl.NumberFormat('en-GB').format('Infinity'); | ||
| new Intl.NumberFormat('en-GB').format('-Infinity'); | ||
| new Intl.NumberFormat('en-GB').format('+Infinity'); | ||
|
|
||
| // Test approximatelySign part type | ||
| const nf = new Intl.NumberFormat("en-US", { | ||
| style: "currency", | ||
| currency: "EUR", | ||
| maximumFractionDigits: 0, | ||
| }); | ||
|
|
||
| const filtered = nf | ||
| .formatRangeToParts(100, 100) | ||
| .filter((part) => part.type !== "approximatelySign") | ||
| .map((part) => part.value) | ||
| .join(""); | ||
|
Comment on lines
+45
to
+47
|
||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test file consistently uses single quotes for string literals (e.g. earlier Intl.NumberFormat calls). Consider switching these newly added string literals to single quotes as well to match the existing style and keep baselines stable.