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

Milliseconds are represented separately even when "detailed" is set to False #10

Closed
edigaryev opened this issue Aug 8, 2016 · 1 comment

Comments

@edigaryev
Copy link

Hi,

The documentation says:

detailed – If True milliseconds are represented separately instead of being represented as fractional seconds (defaults to False).

But in some cases milliseconds are displayed anyway:

>>> import humanfriendly as hf

>>> hf.format_timespan(59.99)
'59.99 seconds'

>>> hf.format_timespan(61.10)
'1 minute, 1 second and 100 milliseconds'

>>> hf.format_timespan(61.10, False)
'1 minute, 1 second and 100 milliseconds'

>>> hf.format_timespan(3600 * 123 + .456)
'5 days, 3 hours and 456 milliseconds'
xolox added a commit that referenced this issue Sep 28, 2016
Refer to issues 10 and 11 on GitHub for details:
 - #10
 - #11
xolox added a commit that referenced this issue Sep 28, 2016
Refer to issues 10 and 11 on GitHub for details:
 - #10
 - #11
xolox added a commit that referenced this issue Sep 28, 2016
Python 2.6 breakage noticed on Travis CI:
 - https://travis-ci.org/xolox/python-humanfriendly/builds/163513409

Refer to issues 10 and 11 on GitHub for details:
 - #10
 - #11
@xolox xolox closed this as completed in 08f0d40 Sep 28, 2016
@xolox
Copy link
Owner

xolox commented Sep 28, 2016

Hi Nikolay and thanks for the clear bug report, this issue should now be fixed! I first wrote tests that reproduce issues #10 and #11 and then fixed both (and needed to restore Python 2.6 compatibility).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants