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
Is your feature request related to a problem? Please describe.
The number formatter in this package allows number or bigint input only.
When working with very larger numbers, we typically use other libraries that can deal with high precision. However, in order to use next-intl number formatter, we have to turn those numbers back into native number values, which would be lossy and produce incorrect values.
Describe the solution you'd like
Intl.NumberFormat already supports a string param that it can then format losslessly in modern browsers. Seeing how we delegate to this library anyway, it would be good to broaden the type of number() function.
This way we can pass large numbers as string to the formatter and get a correct representation out.
Describe alternatives you've considered
My workaround is to just get the locale and do my own Intl.NumberFormat formatter. But then I have to forego or re-implement all the nice locale-awareness and caching that next-intl has already got.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
The number formatter in this package allows
number
orbigint
input only.When working with very larger numbers, we typically use other libraries that can deal with high precision. However, in order to use
next-intl
number formatter, we have to turn those numbers back into native number values, which would be lossy and produce incorrect values.Describe the solution you'd like
Intl.NumberFormat
already supports astring
param that it can then format losslessly in modern browsers. Seeing how we delegate to this library anyway, it would be good to broaden the type ofnumber()
function.This way we can pass large numbers as string to the formatter and get a correct representation out.
Describe alternatives you've considered
My workaround is to just get the locale and do my own
Intl.NumberFormat
formatter. But then I have to forego or re-implement all the nice locale-awareness and caching thatnext-intl
has already got.The text was updated successfully, but these errors were encountered: