Get currency symbol using javascript?

Highlighted
Excursionist
38 0 4

My app show product recommendation in product page, the response from my app have price without currency symbol. Is there any way to get shop currency symbol through javascript.

 

I can get shop currency via Shopify.currency but i need currency symbol.

 

Is there any way?

0 Likes
Shopify Staff
Shopify Staff
1118 78 156

Hey there, 

 

I'm not aware of any way to do this with javascript, but it is available on the shop object at `/admin/shop.json` under the `money_with_currency_format` field. 

 

You may be able to utilize that, though admittedly it will fall short on any Shopify Plus shops that are using multiple currencies. If that won't be a suitable solution for you, my only other recommendation coming to mind would be to continue to use Shopify.currency but then map the currency names to their associated symbols manually. 

 

 

1 Like
Excursionist
38 0 4

i can get money_format from user details so can it will be like '${amount}'

 

Is it a good way to remove {amount} from that string and get the symbol?

 

@Josh 


@Josh wrote:

Hey there, 

 

I'm not aware of any way to do this with javascript, but it is available on the shop object at `/admin/shop.json` under the `money_with_currency_format` field. 

 

You may be able to utilize that, though admittedly it will fall short on any Shopify Plus shops that are using multiple currencies. If that won't be a suitable solution for you, my only other recommendation coming to mind would be to continue to use Shopify.currency but then map the currency names to their associated symbols manually. 

 

 


 

0 Likes