Helper Filters

filesize

Converts a file size in bytes to a human-readable file size.

{{ product.files[0].filesize:filesize }}

Would print something like:

56.3MB

coupon_discount

Formats a coupon discount.

{{ order.coupons[0]|coupon_discount }}

Would print:

> 15% or $10.00

Depending on whether the coupon was a percentage or flat amount.

markdown

Parses the text as markdown and returns HTML.

{{ "This is some text."|markdown }}

Would print:

<p>This is some text.</p>

money

Formats a money value with currency symbol.

{{ product.price|money }}

Would print:

$29.95

money_without_currency

Formats a money value without any currency indication.

{{ product.price|money_without_currency }}

Would print:

29.95

money_with_currency

Formats a money value with the currency symbol and currency code.

{{ product.price|money_without_currency }}

Would print:

$29.95 USD