Liquid Filter Reference for money - v0.9.5

Filter Name money
Group Numbers
Version 0.9.5

Description

Formats the input as money in the default currency

Examples

When the cents are non-zero, it shows the cents:
{{ 12.76 | money }}
$12.76
When the cents are zero, it shows the cents:
{{ 12.00 | money }}
$12.00

Options

compact

Removes insignificant decimals

When the cents are non-zero, it shows 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

unit

Sets the currency sign

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

Back to Filter List

Back to Liquid Reference for 0.9.5

 

 
Back to Documentation