money_ without_ trailing_ zeros
number | money_without_trailing_zeros
returns string
Formats a given price based on the store's HTML without currency setting, excluding the decimal separator
(either . or ,) and trailing zeros.
If the price has a non-zero decimal value, then the output is the same as the money filter.
{{ product.price | money_without_trailing_zeros }}
Code
{{ product.price | money_without_trailing_zeros }}Data
{
"product": {
"price": "10.00"
}
}Output
$10
Output
$10Was this page helpful?