Skip to content

humanize.naturaldelta() always rounds down #174

@lunaynx

Description

@lunaynx

What did you do?

import humanize
humanize.naturaldelta(10799)

Note that this is exactly one second below 3 hours.

What did you expect to happen?

It should say 3 hours.

What actually happened?

It says 2 hours.

What versions are you using?

  • OS: Debian 12
  • Python: 3.11.2
  • Humanize: 4.9.0

Please include code that reproduces the issue.

The best reproductions
are
self-contained scripts
with minimal dependencies.

import humanize
print(humanize.naturaldelta(10800))  # "3 hours"
print(humanize.naturaldelta(10799))  # "2 hours"

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions