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.
1
{{ price_modifier }} // $1.00
2
{{ price_modifier | add_operator }} // +$1.00
Copied!

Format Price

Use this modifier to format an integer price variable to a nice currency string.
1
{{ price }} // 1699
2
{{ price | format_price }} // $16.99
Copied!

Strip Unit

Use this modifier to strip the currency, length, or weight unit from a variable.
1
{{ price }} // $19.99
2
{{ price | strip_unit }} // 19.99
3
4
{{ length }} // 10 in
5
{{ length | strip_unit }} // 10
6
7
{{ weight }} // 3.5 oz
8
{{ weight | strip_unit }} // 3.5
Copied!
Last modified 8mo ago