arrow-py / arrow

🏹 Better dates & times for Python
https://arrow.readthedocs.io
Apache License 2.0
8.71k stars 673 forks source link

Floats in humanize output for languages overriding _format_timeframe #789

Closed krisfremen closed 3 years ago

krisfremen commented 4 years ago

Issue Description

Doing humanize on languages that override _format_timeframe is spitting out floats instead of integers which is not nice on the eye.

arrow.utcnow().shift(weeks=5).humanize(locale="en", granularity="day")
'in 35 days'
arrow.utcnow().shift(weeks=5).humanize(locale="bg", granularity="day")
'напред 35.0 дни'
arrow.utcnow().shift(seconds=55000).humanize(locale="bg", granularity="minute")
'напред 916.6666666666666 минути'

System Info

mohtamba commented 4 years ago

I would be interested in fixing this issue. Is this still open or has someone else decided to fix it?

krisfremen commented 4 years ago

Hmm, I must've not pushed my fixes. I have two fixes, one of which breaks some tests due to ints vs floats.

Will push soon.

egannon commented 3 years ago

I can give this a try as well!