Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding "precise" flag for naturaltime/delta which outputs tenths of integers #80

Closed
wants to merge 1 commit into from

Conversation

leopd
Copy link

@leopd leopd commented Oct 8, 2019

I often find it confusing and unhelpful for humanize to represent everything between 1.000 and 1.999 as 1, as in:

>>> humanize.naturaltime(datetime.datetime.now() - datetime.timedelta(seconds=7000))
'an hour ago'

So I added a precise flag to naturaltime and naturaldate so they'll output tenths, as in:

>>> humanize.naturaltime(datetime.datetime.now() - datetime.timedelta(seconds=7000), precise=True)
'1.9 hours ago'

timwedde added a commit to timwedde/humanice that referenced this pull request Dec 12, 2019
@hugovk hugovk added changelog: Added For new features enhancement New feature or request labels Feb 19, 2020
@hugovk
Copy link
Collaborator

hugovk commented May 3, 2022

🚀 Development has moved to https://github.com/python-humanize/humanize 🚀

Please open new PRs at https://github.com/python-humanize/humanize/pulls

@hugovk hugovk closed this May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: Added For new features enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants