How can I eliminate '.00' from converted prices?

Topic summary

Issue: remove trailing “.00” from prices after currency conversion in a Shopify theme.

  • Initial approach: switching Liquid from {{ amount }} to {{ amount_no_decimals }} and using {{ 25000 | money | remove ‘.00’ }} works in the default currency but not after currency change (still shows .00).

  • Recommended filter: {{ money_without_trailing_zeros }} (Shopify money filters). It removes unnecessary decimals generally, but in this case it does not work when the currency is switched.

  • Multiple currency context: not using Shopify’s built‑in multi‑currency; switching currency does not add a country code to the URL.

  • Script-based workaround: adding a script before the tag in theme.liquid was suggested and reportedly removes decimals on initial page load.

  • Dynamic update issue: when changing product variants, decimals reappear because the script doesn’t re-run for the new variant URL/state; a full page refresh restores the desired display.

Outcome: no confirmed fix. Open questions: how to apply decimal removal reliably for converted prices and ensure it persists during dynamic variant changes without requiring a refresh.

Summarized with AI on December 13. AI used: gpt-5.

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.

@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.

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”.

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?

@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.

Hey,

  1. In your Shopify Admin go to online store > themes > actions > edit code and search theme.liquid file.
  2. In your theme.liquid file, find the (press CTRL + F on Windows or command + F on Mac)
  3. paste this code right above the tag:

Hello Muhammad,

Your script works, but when I change variant on the product page, the price displays the decimals again (the script doesn’t load again for the new url of the new selected variant).

How can I fix this please ?

2 Likes

Same issue for me - works when you refresh screen though.