Skip to content

Number mask shows -0 instead of 0 when max=0 #1134

Description

@danilkinkin

Describe the bug
Number mask incorrectly displays -0 instead of 0 when max is set to 0 and user inputs zero.

To Reproduce

  1. Go to https://imask.js.org/guide.html#number
  2. In the options panel, set Max to 0
  3. Type 0 in the input field
  4. Observe that it shows -0 instead of 0

Expected behavior
When user inputs 0, it should display 0, not -0. Zero should not have a negative sign.

Screenshots/Demo
You can reproduce this on the official demo page by setting max=0.

Environment:

  • OS: macOS 15 (исправил версию, macOS 26 не существует)
  • Browser: Arc (Chromium Engine 140.0.7339.208)
  • IMask version: 7.6.1
  • Framework: React with react-imask plugin

Additional context
This issue occurs specifically when:

  • min is negative (e.g., -999)
  • max is 0
  • User types 0

The typedValue is correct (returns 0), but the displayed value shows -0 which is confusing for users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions