strings can be implicitly coerced to numeric values, so comparisons like:
{% if "1000" > 5%}
works. However evaluating:
{% if "1,000" > 5%}
or:
{% if "1000.25" > 5%}
throws an error. This adds some additional cleaning to allow formatted number strings to be parsed.
Notably it does not remove decimals when comparing to floats, since those are valuable and:
{% if "1000.25" > 50.0 %}
already works.
It also only removes characters after decimals if its a properly formatted decimal number (so containing no non-digit characters and only one decimal point)
strings can be implicitly coerced to numeric values, so comparisons like:
works. However evaluating:
or:
throws an error. This adds some additional cleaning to allow formatted number strings to be parsed. Notably it does not remove decimals when comparing to floats, since those are valuable and:
already works.
It also only removes characters after decimals if its a properly formatted decimal number (so containing no non-digit characters and only one decimal point)