liquid icon indicating copy to clipboard operation
liquid copied to clipboard

Simple mathematical operations on INT transforms them in FLOAT

Open GauthierHacout opened this issue 9 months ago • 0 comments

⚠ The ISSUE_TEMPLATE.md doesn't seem to work anymore, I had to manually copy the contents of the file to fill this issue ⚠

Checklist

  • [ X] I have searched the issue list
  • [ X] I have tested my example against Shopify Liquid. (Tested against both LiquidJS & Shopify Liquid implementation)

Version

I'm using v1.6.0

Expected Behavior

I was a bit confused when I realized that applying a simple "minus" to an Int will transform it into a Float.

For example:

{{ 1743096453 | minus: 7 }}

Liquid JS / Shopify Liquid implementation will result in 1743096446

Actual Behavior

{{ 1743096453 | minus: 7 }}

Will result in

 1.743096446e+09 

Which is mathematically correct but is very confusing to read and not intuitive. What do you think about this ? If it considered as a bug or is it an expected behavior of this library ?

Possible Solution

GauthierHacout avatar Mar 27 '25 18:03 GauthierHacout