Im trying to assign a variable that has been converted from a string but the result variable stays as a string
{% assign multi_qty = multi_qty_str | to_i %}> {% if multi_qty > 0 %}> > {% endif %}
The above throws an error “Liquid error: comparison of String with 0 failed”
The below works but is it possible to avoid type casting each time
{% assign multi_qty = multi_qty_str | to_i %}> {% if multi_qty | to_i > 0 %}> > {% endif %}
I’ve tried:
{% assign multi_qty = (multi_qty_str | to_i) %}
And:
{% assign multi_qty = multi_qty_str | to_i + 0%}
but still show the same error