Issue with Money Format

Arun_Kumar
Shopify Partner
101 12 25

Suppose a product is having a price 78,79
Now there are two cases, 

1st Case - Set the Currency Formatting in Store Currency "HTML with currency" and "HTML without currency" as {{amount_with_comma_separator}}€  and then on Product page, you can check the difference by adding this code

{{ variant.compare_at_price | money_without_currency | times: 2 }}   --->   156[Result]  
{{ variant.compare_at_price | amount_without_currency | times: 2 }}   --->  15758[Result]
Copy

The correct amount is 15778, but why when "money_without_currency" is present, the calculation is 156 ??

2nd Case - Set the Currency Formatting in Store Currency "HTML with currency" and "HTML without currency" as {{amount}}€  and then on Product page, you can check the difference by adding this code

{{ variant.compare_at_price | money_without_currency | times: 2 }}  ---> 157.58[Result]  
{{ variant.compare_at_price | amount_without_currency | times: 2 }}  ---> 15758[Result]
Copy

Now the amount calculated is correct.

Why there is difference when the Currency Formatting is set as {{amount_with_comma_separator}}€  ??

If you think my solution is good, then please Like and Accept the Solution.
Happy To Help You :)
0 Likes
Dirk
Shopify Staff
Shopify Staff
912 99 205

Hey, @Arun_Kumar 

You can change the way that currencies are shown on your store to make it easier for your customers to read the amounts. There are 4 different currency formatting types that are used in different parts of your store. You can see that breakdown here.

Then for each currency type you have several different ways, we have a breakdown of them here.

Lastly, I suggest checking out our money filters documentation to give you a greater understanding of how these filters format prices based on the currency format settings you chose in your settings.

I hope this helps! If there is anything else I can help you with, please let me know.

 

Dirk | Social Care @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

0 Likes
Arun_Kumar
Shopify Partner
101 12 25

Hey @Dirk 

Thank you for replying, and i do understand the Currency Formatting.

But my case is different. I am trying to create a functionality on the Product Page. And i have to double the Price. But the problem is, in some case as mentioned in my query while doubling the amount, the calculated result is getting wrong. Can you please try on your test store and see what i am trying to explain. This will help you understand my problem better.

If you think my solution is good, then please Like and Accept the Solution.
Happy To Help You :)
0 Likes
Dirk
Shopify Staff
Shopify Staff
912 99 205

Hey, @Arun_Kumar 

Thanks for the additional context. I'm not trained in code so I can't offer specific advice. However, I'd recommend reaching out to a Shopify expert who could assist you in coding this sort of functionality into your product pages.

If there is anything else I can help you with, please let me know.

Dirk | Social Care @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

0 Likes
Arun_Kumar
Shopify Partner
101 12 25

Hey @Dirk 

I know some coding in Shopify's Liquid programming, and figured out different method. But i think this is some kind of issue in the money formatting and Shopify must take care of it or they can provide some doc on this as they have provided other docs.

Thank you 

If you think my solution is good, then please Like and Accept the Solution.
Happy To Help You :)
0 Likes