Liquid Tutorial

Money & Number Filters

Source: Coding with Robby

Displaying Prices Correctly

Shopify stores all monetary values as integers in the smallest currency unit. $18.99 is stored as 1899. Never divide manually — money filters handle currency symbols, decimal separators, and multi-currency display.

Sale savings calculation
{{ product.price | money }}
{# $18.99 in a US store #}

{{ cart.total_price | money_with_currency }}
{# $42.00 USD #}

{% assign savings = product.compare_at_price | minus: product.price %}
{{ savings | money }} off

Math Filters

Perform arithmetic in Liquid when building sale badges, progress bars, or installment messaging.

Arithmetic filters
{{ 10 | plus: 5 }}
{{ 20 | minus: 3 }}
{{ 4 | times: 2 }}
{{ 10 | divided_by: 2 }}
{{ 17 | modulo: 5 }}
Note: divided_by performs integer division. For percentage discounts, use times with decimals: price | times: 0.8 for 20% off.