Closed shiribailem closed 11 months ago
I ran into a weird behavior around math operations... turns out any operation you do on a variable, ironically even (int x) turns it into a string. In most cases this doesn't matter, but it causes a problem with comparisons in test.
Example:
{{set 'test' 3}} {{#test (int @data.test) 'geq' 10}} True {{else}} False {{/test}}
The expected outcome is False because 3 is less than 10... but you get True because in string comparisons "3" is greater than "10".
The "int" returns an integer but in an "stringinterpreted" environment `{{set 'test' 3}}
{{#test @data.test 'geq' 10}} True {{else}} False {{/test}}`
works
I ran into a weird behavior around math operations... turns out any operation you do on a variable, ironically even (int x) turns it into a string. In most cases this doesn't matter, but it causes a problem with comparisons in test.
Example:
The expected outcome is False because 3 is less than 10... but you get True because in string comparisons "3" is greater than "10".