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
We are using the FormatJS forced polyfills in an number formatting internal library to ensure that our frontend, backend, and testing environments all have consistent behavior when calling Intl.NumberFormat and Intl.DateTimeFormat.
However, de-AT is a required locale for us and the force polyfill is resulting in incorrect output according to both real browser behavior and this CLDR spec.
I can see the correct currencyGroup in the generated de-AT.js file in my node_modules folder:
However, this correct separator doesn't seem to be getting applied as expected and we are seeing the non-currency group separator (a non-breaking space) applied to currency instead.
Run the following code, and observe the incorrect output:
console.log(
new Intl.NumberFormat("de-AT", {
style: "currency",
currency: "EUR",
}).format(1234567)
);
Codesandbox URL
Code sandbox can be found here. You can comment out the import for the force polyfill and refresh the code sandbox browser to see that this is indeed an issue with that import.
Expected behavior
Currency formatted for the de-AT locale should use periods as a group separator. i.e.:
As an aside we are on a time crunch here to get a fullstack de-AT formatter working for an internationalized demo, and so I would absolutely love a workaround if anyone knows one, even if we can't get an actual fix right away!
Which package?
@formatjs/intl-numberformat
Describe the bug
We are using the FormatJS forced polyfills in an number formatting internal library to ensure that our frontend, backend, and testing environments all have consistent behavior when calling Intl.NumberFormat and Intl.DateTimeFormat.
However,
de-AT
is a required locale for us and the force polyfill is resulting in incorrect output according to both real browser behavior and this CLDR spec.I can see the correct
currencyGroup
in the generatedde-AT.js
file in my node_modules folder:However, this correct separator doesn't seem to be getting applied as expected and we are seeing the non-currency group separator (a non-breaking space) applied to currency instead.
To Reproduce
npm add @format-js/intl-numberformat@latest
Codesandbox URL
Code sandbox can be found here. You can comment out the import for the force polyfill and refresh the code sandbox browser to see that this is indeed an issue with that import.
Expected behavior
Currency formatted for the
de-AT
locale should use periods as a group separator. i.e.:Current incorrect output:
€ 12 345 678,00
Expected correct output:
€ 12.345.678,00
The text was updated successfully, but these errors were encountered: