Skip to content

Round fractional seconds instead of truncating - #42

Open
jeremander wants to merge 1 commit into
wroberts:masterfrom
jeremander:round-fractional-seconds
Open

jeremander wants to merge 1 commit into
wroberts:masterfrom
jeremander:round-fractional-seconds

Conversation

@jeremander

@jeremander jeremander commented Oct 24, 2026 •

Copy link
Copy Markdown

I noticed the update in #38 changed the output of timeparse('0.3333333333333333 days') from 28800 to 28799. This is because Decimal is more precise than float, so that numbers just shy of an integer are more likely to get truncated by the int coercion.

This change switches the behavior from truncation to rounding when fractional seconds occur, which should be more in line with user expectations.

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

Successfully merging this pull request may close these issues.

1 participant