Mechanic now supports a new
currency
filter, used for formatting numbers as currency. This filter defaults to the store's primary currency and default locale, and accepts overrides for both values.
Example usage:
{{ "100000.0" | currency }}
{{ 100000.0 | currency: "EUR" }}
{{ 100000 | currency: "EUR", locale: "fr" }}
{{ 100000 | currency: locale: "fr" }}
Output, for a store based in USD and defaulting to English:
$100,000.00
€100,000.00
€100 000,00
$100 000,00
Read more