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

Timedot: Decimal rounding issue #2096

Closed
lstellway opened this issue Oct 10, 2023 · 3 comments
Closed

Timedot: Decimal rounding issue #2096

lstellway opened this issue Oct 10, 2023 · 3 comments
Labels
A-BUG Something wrong, confusing or sub-standard in the software, docs, or user experience. timedot The timedot file format.

Comments

@lstellway
Copy link

Description

While playing with the .timedot format, I noticed a rounding error. Here's a simple example to reproduce.

Example file:

; test.timedot
2023-10-03
Test Account  15m

Command used to print the ledger:

$ hledger print -f test.timedot
# 2023-10-03 *
#     (Test Account)    0.24999999999999999

Version info:

$ hledger --version
# hledger 1.31, mac-aarch64

Resources

@lstellway lstellway added the A-BUG Something wrong, confusing or sub-standard in the software, docs, or user experience. label Oct 10, 2023
@simonmichael simonmichael added timedot The timedot file format. needs:debugging To unblock: needs debugging/investigation labels Oct 10, 2023
@simonmichael
Copy link
Owner

I have pushed a fix, which should land in master soon. Thanks for the report!

@simonmichael simonmichael removed the needs:debugging To unblock: needs debugging/investigation label Oct 17, 2023
@simonmichael
Copy link
Owner

simonmichael commented Oct 17, 2023

More details: this affected quantities with a number and a unit (like 15m). Now after conversion to hours they are rounded to two decimal places.

@lstellway
Copy link
Author

Beautiful, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-BUG Something wrong, confusing or sub-standard in the software, docs, or user experience. timedot The timedot file format.
Projects
None yet
Development

No branches or pull requests

2 participants