Skip to content

fix: update getSymbols in NumberParser to support roundingIncrement #7186

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
merged 1 commit into from
Oct 15, 2024

Conversation

snowystinger
Copy link
Member

Closes #7168

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

@rspbot
Copy link

rspbot commented Oct 14, 2024

maximumSignificantDigits: 21,
roundingIncrement: 1,
roundingPriority: 'auto',
roundingMode: 'halfExpand'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming that none of these options affect the result? e.g. if the user passed in different values in intlOptions this would override.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, this is only to get possible symbols. By overriding these with the defaults we get possibly a few extra symbols that aren't possible with the users options, but that won't hurt anything.

I do not believe that any combination of these three options will add additional symbols. Though it is an assumption that I've made based on: it has worked like this for 4 years before Chrome added these values into the resolvedOptions.

@snowystinger snowystinger added this pull request to the merge queue Oct 15, 2024
@yihuiliao yihuiliao changed the title Fix NumberParser getSymbols rounding support fix: update getSymbols in NumberParser to support roundingIncrement Oct 15, 2024
Merged via the queue into main with commit f459c18 Oct 15, 2024
29 checks passed
@snowystinger snowystinger deleted the fix-numberformatting branch October 15, 2024 21:25
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

Successfully merging this pull request may close these issues.

getSymbols throws when using roundingIncrement >= 2
4 participants