Money Filters
Format prices and currency values using store settings.
Money filters turn numbers into prices. They add the right symbol, put the dot in the right place, and follow the rules in your store settings. You never need to hard-code a currency symbol.
money
Show a price in the format set by your store:
{{ product.price | money }}Output: £29.99
The symbol and format come from your store settings. If your store uses euros, the same filter gives you €29,99 instead.
Prices are stored in the smallest unit of the currency (pence for GBP, cents for USD). The money filter does the maths for you:
<!-- product.price is 2999 (pence) -->
{{ product.price | money }}Output: £29.99
money_with_currency
Add the three-letter code after the price so the reader knows which currency it is:
{{ product.price | money_with_currency }}Output: £29.99 GBP
This helps when you sell to more than one country. The code makes it clear which currency you mean, since the $ sign is used by many countries.
money_without_trailing_zeros
Remove .00 from whole-number prices:
{{ product.price | money_without_trailing_zeros }}If the price is £30.00, the output is £30. If the price is £29.99, the output stays £29.99.
This creates a cleaner look for round prices.
money_without_currency
Show the price with the symbol but without the three-letter currency code:
{{ product.price | money_without_currency }}Output: £29.99
Compare this with money_with_currency, which outputs £29.99 GBP. Use this filter when the currency is obvious from context and you want a compact display.
Multi-currency stores
Money filters work with the built-in currency system. When a visitor picks a different currency, the filters show the right value with the right symbol. No extra code is needed:
{{ product.price | money }}A UK visitor sees £29.99. A US visitor sees $38.99. The filter picks the right format for each person.
You do not need one template per currency. The same filter works for all of them.
Practical examples
Compare prices
Show original and sale prices side by side:
{% if product.compare_at_price > product.price %}
<span class="original-price">{{ product.compare_at_price | money }}</span>
<span class="sale-price">{{ product.price | money }}</span>
{% else %}
<span class="price">{{ product.price | money }}</span>
{% endif %}Free shipping threshold
{% assign remaining = 5000 | minus: cart.total_price %}
{% if remaining > 0 %}
<p>Spend {{ remaining | money }} more for free shipping</p>
{% else %}
<p>You qualify for free shipping</p>
{% endif %}Price per unit
{% assign unit_price = product.price | divided_by: product.quantity %}
<p>{{ unit_price | money }} per unit</p>