Remove '.00' from the converted prices.

err404
New Member
5 0 0

Hi, i am trying to remove the decimal ".00" from my converted prices, first of all, i have changed the {{ amount }} to {{ amount_no_decimals }}, so it worked perfectly with the default currency.

So what i did is, i added the remove filter to the price tag, {{ 25000 | money | remove '.00' }}, also it is working normally with the default currency, but when i change the currency it remains 250.00.

So any idea what can i do to remove the '.00' from the converted prices?

Thank you.

0 Likes

@err404 
Check out this link I hope it will be helpful for you.
http://help.forsbergplustwo.com/en/articles/3960068-adding-and-removing-decimals-from-prices


Thank you.

If helpful, please Like and Accept Solution. if you Want to modify or Customize your theme, Hire us. or Want to know more. Read our Shopify Blogs.
Email us: sales@zworthkey.com Contact us: https://www.zworthkey.com/shopify-services/
0 Likes
err404
New Member
5 0 0

Hey @Zworthkey ,

Thank you for your reply, and that's what i did and mentioned in my post, it works with the default currency, but when i switch the currency, i still have ".00".

0 Likes
samthewebb
Shopify Partner
24 3 2

I just wait to point out that instead of doing this:

{{ 25000 | money | remove '.00' }}

You should be doing this:

{{ 25000 | money_without_trailing_zeros }}

See Shopify's documentation on money filters for more info on that https://shopify.dev/api/liquid/filters/money-filters

Are you using Shopify's multiple currency feature and when you switch to another currency does it change the URL to have a country code in it?

Sam Webb
https://samthewebb.com
sam@samthewebb.com
0 Likes
err404
New Member
5 0 0

@samthewebb 

No, i am not using Shopify's multiple currency feature and when i switch to another currency it doesn't change the URL to have a country code in it. And thank you for sharing the code snippet

{{ 25000 | money_without_trailing_zeros }}

but it doesn't work with the switched currency.

0 Likes