Quantcast
Channel: Opinion: Shopify Community - Shopify APIs & SDKs
Viewing all articles
Browse latest Browse all 25503

RemiB commented on Currency switcher displays symbol. How do I prevent that?

$
0
0

Hi Askel,

If I understand correctly, you use the Currency.money_with_currency_format formatting.

Currency.money_with_currency_format['SEK'] = "{{amount_with_comma_separator}} SEK"
and
Currency.money_with_currency_format['NOK'] = "{{amount_with_comma_separator}} NOK"

During the conversion, the function Currency.formatMoney in jquery.currencies.min.js is being used, but specifically for this formatting ({{amount_with_comma_separator}}, the separator being the decimals' separator) it doesn't try to add a thousands separator. That is because your function adding this thousands separator always uses a comma. And having the same separator for thousands and decimals would be confusing.

You don't have the problem with DKK because it is your shop's currency, the conversion does not happen.

If you want to keep the same formatting as for DKK, you could do it this way:
In your jquery.currencies.min.js, look for

case"amount_with_comma_separator":e=floatToString(b/100,2).replace(/\./,",");break;
and try to replace it with
case"amount_with_comma_separator":d=floatToString(b/100,2).replace(/\./,",").replace(/(\d+)(\d{3}[\.,]?)/,"$1.$2");break;

 


Viewing all articles
Browse latest Browse all 25503

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>