You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
shermanhui
changed the title
Typescript error when a string value is passed to formatNumber and formatNumberToParts
Typescript error when a string value is passed to formatNumber
Dec 29, 2022
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.
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.
Which package?
intl
(react-intl
) and potentiallyintl-numberformat
Describe the bug
Typescript throws a type error when a string value is passed to
formatNumber
To Reproduce
Pass a string value to these formatters in a Typescript project
Codesandbox URL
https://codesandbox.io/s/nervous-joji-b8i01h?file=/src/App.tsx
Reproducible Steps/Repo
N/A
Expected behavior
Should not throw a TS error as
Intl.NumberFormat
docs indicate thatstring
values are supported.Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
N/A
Additional context
Intl.NumberFormat
docs indicate thatstring
values should be supported hereTests within
intl
package also indicate thatstring
values are supported hereIt also looks like the
numberformat
tests in thev8
mirror on Github also have tests that indicate support forstring type values here
The text was updated successfully, but these errors were encountered: