Modifiers

currency

The currency modifier formats a numeric value as money.

In WooCommerce templates, use it without an argument so WooCommerce formats the amount with the store currency, decimal settings, separators, and price markup:

Example#

php
{{ price | currency }}

Outside WooCommerce, or when WooCommerce is not available, TemplateX falls back to $ and two localized decimals.

Empty or non-numeric values render empty. They are not converted to 0.00.

You can pass a fixed symbol when you want simple text output with a specific symbol:

php
{{ total | currency("€") }}

For product prices, {{ price_html }} still prints WooCommerce's full formatted price HTML. Use {{ price | currency }}, {{ regular_price | currency }}, or {{ sale_price | currency }} when you want to format a raw numeric price yourself.