flosch / pongo2

Django-syntax like template-engine for Go
https://www.schlachter.tech/pongo2
MIT License
2.86k stars 269 forks source link

Comparing int and float fails without explicit cast #305

Open ashtonian opened 2 years ago

ashtonian commented 2 years ago

I think an int and float comparison should auto cast the int as a float. Workaround is to cast it with the pongo filters.

{{ 1 == 1.0 }} // false 
{{ 1 == 1.0|integer }} // true 
{{ 1|float == 1.0 }} // true