Skip to content

ordinal() doesn't work with str(float([int])) #518

Closed as not planned
Closed as not planned

Description

@ZiyaoWei

(Apologize if the issue seems a bit artificial - I'm evaluting a PBT tool using humanize, so it is not a real production use case, but I can promise it is not agent slop.)

Assume value is an int, e.g., 1:

ordinal(value, gender)
ordinal(float(value), gender)
ordinal(str(value), gender)
ordinal(str(float(value)), gender)

The first three return "1st" while the last returns "1.0", since int("1.0") fails.

IDK if it necessarily a bug but I do think the behavior is confusing. It is similar to #414 but has a slightly different focus. Feel free to close but thought I'd report!

Activity

  1. hugovk commented on Nov 16, 2026

    @hugovk
    Member

    Thanks for the report!

    Let's close it, it does seem a bit artificial to pass in "1.0" via str(float(1)), and 1 and 1.0 and "1" all work.

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