Skip to content

Rounding negative half rounds toward zero instead of away from zero #871

Closed

Description

@timbze

E.g. {{ -2.5 | round }} output is -2, but I expect -3. This is how JS rounding works by default i.e. toward zero. I checked shopify liquid ruby code and there it is as I expected that -2.5 rounds to -3. Playground with shopify code: https://onecompiler.com/ruby/44jntbqdy

How JS in this repo now works: https://onecompiler.com/typescript/44jntmy9w

Activity

  1. added a commit that references this issue on Apr 7, 2026
    df943f4
  2. github-actions commented on Apr 7, 2026

    @github-actions

    🎉 This issue has been resolved in version 10.25.5 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions