humanize icon indicating copy to clipboard operation
humanize copied to clipboard

`humanize.naturaldelta()` always rounds down

Open lunaynx opened this issue 11 months ago • 1 comments

What did you do?

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.

print(humanize(10800))  # "3 hours"
print(humanize(10799))  # "2 hours"

lunaynx avatar Feb 25 '24 14:02 lunaynx