check for 0 on a template value that can be a string of "0.00" too

Is there a more efficient way to do this ?

{% if transfer_total == "0.00" or transfer_total == 0 %}
    (0)
{% else %}
    ({{ transfer|length }})
{% endif %}

Possibly - it would be more efficient if you could “normalize” the value in the view.

1 Like