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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(@formatjs/intl): update IntlFormatters.formatNumber value type #3950

Closed

Conversation

shermanhui
Copy link

I opened #3949 because I noticed a TS error was being thrown when passing a string type value to formatNumber, which I don't believe should be raised since Intl.FormatNumber.prototype.format does support string values as indicated here

Please let me know if there's anything I've missed! Apologies if I've jumped the gun on creating a PR prior to having my issue triaged 馃檹馃徎

formatNumber and formatNumberToParts should
support string values as indicated in MDN docs.

Unfortunately, it seems like `Intl.NumberFormat` type in V8
doesn't explicitly strings which contradicts what is indicated in the
documentation and what happens when a string value is passed
in, so I've case the `value` as a `number` in `number.ts`.
update to expect string value types to reflect
changes made in @formatjs/intl
update to expect string value types to reflect
changes made in @formatjs/intl
update docs to reflect type updates
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Jan 14, 2023
@longlho
Copy link
Member

longlho commented Jan 16, 2023

looks like u'd have to fix TypeScript inlt lib d.ts itself before making this patch

@github-actions github-actions bot removed the Stale label Jan 17, 2023
@shermanhui
Copy link
Author

I see, thanks for the comment @longlho. I'll close the loop in the issue that I opened with reference to your comment.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Feb 26, 2023
@github-actions github-actions bot closed this Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants