money - Liquid Filter Reference - 1.0.0

Filter Name money
Group Numbers
Version 1.0.0

Description

Formats the input as money in the default currency

Examples

When the cents are non-zero, it retains the cents:
{{ 12.76 | money }}
$12.76
When the cents end in a zero, it retains the cents:
{{ 12.70 | money }}
$12.70
When the cents are zero, it removes the cents:
{{ 12.00 | money }}
$12

Options

compact

Affects the presence of insignificant decimals

When the cents are non-zero, it retains the cents:
{{ 12.76 | money, compact: true }}
$12.76
When the cents end in a zero, it removes the zero:
{{ 12.70 | money, compact: true }}
$12.7
When the cents are zero, it removes the cents:
{{ 99.00 | money, compact: true }}
$99
When the cents end in a zero, it retains the zero:
{{ 12.70 | money, compact: false }}
$12.70
When the cents are zero, it retains the cents:
{{ 99.00 | money, compact: false }}
$99.00

unit

Sets the currency sign

When a unit is specified, it uses the unit:
{{ 12.95 | money, unit: '!' }}
!12.95
When an empty unit is specified, it shows no currency sign:
{{ 12.95 | money, unit: '' }}
12.95

Back to Filter List

Back to Liquid Reference for 1.0.0

 

 
Back to Documentation