Skip to content
Log in

money - Liquid Filter Reference

On this page

Description

Formats the input as money in the default currency. The currency symbol and locale are taken from the currency configured on your store in Salesforce. To change which currency your store uses, update the Currency field on the Store record.

Property Value
Return Type string
Category numbers

Options

Option Description
compact Controls trailing zero removal. true strips all insignificant zeros; false always shows two decimal places. Default: strips cents only when the value is a whole number.
unit Overrides the store’s currency symbol. Pass an empty string to show the amount with no symbol. Default: the store’s configured currency symbol.

Examples

Default behavior

Non-zero cents are always shown:

```liquid

{{ 12.76 | money }} ```

Output: $12.76

A trailing zero in cents is retained:

```liquid

{{ 12.70 | money }} ```

Output: $12.70

Whole numbers have cents removed by default:

```liquid

{{ 12.00 | money }} ```

Output: $12

compact

compact: true strips all insignificant trailing zeros, including a single trailing zero within the cents:

```liquid

{{ 12.70 | money, compact: true }} ```

Output: $12.7

```liquid

{{ 99.00 | money, compact: true }} ```

Output: $99

Non-zero cents are unaffected:

```liquid

{{ 12.76 | money, compact: true }} ```

Output: $12.76

compact: false always shows two decimal places, even for whole numbers:

```liquid

{{ 99.00 | money, compact: false }} ```

Output: $99.00

```liquid

{{ 12.70 | money, compact: false }} ```

Output: $12.70

unit

The money filter uses the currency symbol configured on your store by default. For currencies that share a symbol — such as AUD, USD, and CAD, which all use $ — the output alone does not indicate which currency is being displayed. Use unit to override the symbol and make the currency unambiguous.

:::note The position of the symbol relative to the number is controlled by the store’s locale setting, not by the unit option. On English-locale stores the symbol always appears before the number. Other locales may place it after. :::

For an AUD store, replace the bare $ with A$:

```liquid

{{ 12.95 | money, unit: ‘A$’ }} ```

Output: A$12.95

Euro:

```liquid

{{ 12.95 | money, unit: ‘€’ }} ```

Output: €12.95

Japanese yen (¥ is shared with Chinese yuan — use JP¥ or CN¥ to disambiguate):

```liquid

{{ 1500 | money, unit: ‘JP¥’ }} ```

Output: JP¥1500

```liquid

{{ 1500 | money, unit: ‘CN¥’ }} ```

Output: CN¥1500

You can use any string as the unit, including ISO currency codes:

```liquid

{{ 12.95 | money, unit: ‘AUD ‘ }} ```

Output: AUD 12.95

Pass an empty string to show the amount with no symbol:

```liquid

{{ 12.95 | money, unit: ‘’ }} ```

Output: 12.95

Using money with Liquid objects

The filter works with any numeric value from Liquid objects, such as product prices and cart totals:

```liquid

{{ current_product.pricing.price | money }} ```

Output: $29.95

```liquid

{{ current_cart.total_payable | money }} ```

Output: $149.00

Was this article helpful?

Was this article helpful?