Skip to content

intcomma(num, ndigits=-1) ValueError: Format specifier missing precision #466

Open

Description

@fate-lab

What did you do?
Run a call like humanize.intcomma(12345.111, ndigits=-1).

What did you expect to happen?
I'm not sure what the intended behavior is, but I would expect a clear error message, e.g. ValueError: ndigits must be >= 0.

What actually happened?
ValueError: Format specifier missing precision

What versions are you using?
OS: Windows 10
Python: 3.14.3
Humanize: 4.16.0

Activity

  1. ShahadatTest commented on Oct 21, 2026

    @ShahadatTest

    I am preparing explicit validation for negative ndigits, with a clear ValueError and regression tests for integer, float, and numeric-string values. This keeps the existing non-negative precision behavior. Codex is assisting with the implementation and tests.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions