Skip to content

intword() decides plural or no plural after rounding the number #175

@Luflosi

Description

@Luflosi

What did you do?

Execute

import humanize
_t = humanize.i18n.activate("de_DE")
humanize.intword(1000000)
# returns '1.0 Million'
humanize.intword(1000001)
# returns '1.0 Millionen'

What did you expect to happen?

I would expect humanize.intword(1000001) to at least return the same as humanize.intword(1000000).
Since I think the singular case only applies when the number is exactly 1.0, I think it would be better to return "Eine Million" in both cases.

What actually happened?

The function rounded the integer to 1.0 but chose plural/singular according to the number before it was rounded.

What versions are you using?

  • OS: Linux (NixOS)
  • Python: 3.11.8
  • Humanize: latest master 218a86e

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions