Modifiers

There are a couple of useful modifiers to help you format variables in your templates.

Add Operator

Use this modifier to prepend the correct operator to a money variable.

{{ price_modifier }} // $1.00
{{ price_modifier | add_operator }} // +$1.00

Format Price

Use this modifier to format an integer price variable to a nice currency string.

{{ price }} // 1699
{{ price | format_price }} // $16.99

Strip Unit

Use this modifier to strip the currency, length, or weight unit from a variable.

{{ price }} // $19.99
{{ price | strip_unit }} // 19.99
{{ length }} // 10 in
{{ length | strip_unit }} // 10
{{ weight }} // 3.5 oz
{{ weight | strip_unit }} // 3.5