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
Describe the bug
Formatting USD for a Swedish locale (sv, sv-SE) causes zero decimal places to be appended after the suffix.
1.00 becomes 1 US$,00
The Swedish locales sv, sv-SE, etc, use 0xa0 (non breaking space) as the group separator (as returned from the browser). This causes issues with the regex in getSuffix, because the non-breaking space character is also used as the divider between the amount and the suffix. So if you try to format 1.00 USD into a Swedish locale, you end up with 1 USD$,00. If you include a decimal like 1.01, the regex works fine because it's able to match on the decimal separator.
Expected behavior
Formatting 1.00 USD into Swedish locale should end up as 1,00 US$
Additional context
I was able to work around this issue by determining the decimal and group separators outside of this library, and passing them into the CurrencyInputField. If the group separator is a non-breaking space, I convert it to a regular space to get around the issue.
The text was updated successfully, but these errors were encountered:
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.
Describe the bug
Formatting USD for a Swedish locale (
sv
,sv-SE
) causes zero decimal places to be appended after the suffix.1.00
becomes1 US$,00
The Swedish locales
sv
,sv-SE
, etc, use0xa0
(non breaking space) as the group separator (as returned from the browser). This causes issues with the regex ingetSuffix
, because the non-breaking space character is also used as the divider between the amount and the suffix. So if you try to format1.00
USD into a Swedish locale, you end up with1 USD$,00
. If you include a decimal like1.01
, the regex works fine because it's able to match on the decimal separator.To Reproduce
Expected behavior
Formatting
1.00
USD into Swedish locale should end up as1,00 US$
Additional context
I was able to work around this issue by determining the decimal and group separators outside of this library, and passing them into the
CurrencyInputField
. If the group separator is a non-breaking space, I convert it to a regular space to get around the issue.The text was updated successfully, but these errors were encountered: