Skip to content

Improvements in price formatting

Compare
Choose a tag to compare
@Sega-Zero Sega-Zero released this 24 Nov 23:13
· 5 commits to master since this release
9a66a78

Slightly improved searching of an appropriate locale for price formatting.
It looks like on iOS 13 there might be several locales for specific currency codes and unluckily, the old code may choose the wrong locale. So, we try to find the locale in which currencySymbol differs from currencyCode first.
For example, for RUB we have these locales with RUB currencyCode:
[ba_RU, ru_RU, cv_RU, sah_RU, ce_RU, myv_RU, tt_RU, os_RU, en_RU]
but if we take a look at it's currencySymbol, we see:
"RUB", "₽", "RUB", "₽", "₽" ,"RUB", "₽", "₽", "RUB"

So, since now the library will peek ru_RU locale, since it has more friendly currency formatting.