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

TimePoint dumping buggy for decimals that round up to 1 #184

Closed
MetRonnie opened this issue Sep 14, 2020 · 0 comments · Fixed by #187
Closed

TimePoint dumping buggy for decimals that round up to 1 #184

MetRonnie opened this issue Sep 14, 2020 · 0 comments · Fixed by #187
Assignees
Labels
Milestone

Comments

@MetRonnie
Copy link
Contributor

MetRonnie commented Sep 14, 2020

Example:

>>> TimePoint(year=2020, second_of_minute=5, second_of_minute_decimal=0.9999999)
<metomi.isodatetime.data.TimePoint: 2020-01-01T00:00:05,1.Z>

Instead of 00:00:05,1.Z it should be 00:00:06,0Z.

That would make the behaviour in line with rounding down, e.g.

>>> TimePoint(year=2020, second_of_minute=6, second_of_minute_decimal=0.000000000001)
<metomi.isodatetime.data.TimePoint: 2020-01-01T00:00:06,0Z>

Another question is if the stripping of trailing zeroes when rounding to 6 decimal places is misleading about the precision/number of significant figures

@MetRonnie MetRonnie added the bug label Sep 14, 2020
@MetRonnie MetRonnie added this to the 2.1 milestone Sep 14, 2020
@MetRonnie MetRonnie self-assigned this Sep 14, 2020
MetRonnie added a commit to MetRonnie/isodatetime that referenced this issue Oct 16, 2020
Fix rounding bug for decimal time quantities
MetRonnie added a commit to MetRonnie/isodatetime that referenced this issue Oct 16, 2020
Fix rounding bug for decimal time quantities
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant