-
-
Notifications
You must be signed in to change notification settings - Fork 318
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
1.32+: inaccurate value reports caused by low precision P amounts #2254
Comments
Hi @akanshaG42, thanks for the report. I must admit I'm not seeing an explanation just yet! Here's a simpler example:
The postings will have the same cost (by definition), and if valued with the same market prices, should also have the same value:
I can change the price and/or cost to any integer and the posting values still match.
the postings are valued differently:
I expected both postings to be valued at R52762.5. |
A simpler case:
And it turns out to be a regression, since hledger 1.32:
During the chain of (two) conversions, an intermediate value is inappropriately rounded to the precision of the P directive's amount (one decimal place), causing inaccuracy. You can work around it for now by making sure P amounts have enough decimal digits. Eg for this example, changing it to Thank you @akanshaG42! Please claim your $50 https://hledger.org/REGRESSIONS.html#regression-bounty when convenient. |
…#2254] Valuation in another commoditay could sometimes be inaccurate if the P price amounts did not have enough decimal places.
This is fixed in master. |
Thank you for an incredibly fast turn around here @simonmichael. I tried the CI build with my actual ledger and it is balanced now. Thanks again! |
Hi @akanshaG42, I encourage you to claim your $50 regression finder's bounty within the next 7 days! If not, it will be recorded as a project donation. |
…#2254] Valuation in another commoditay could sometimes be inaccurate if the P price amounts did not have enough decimal places.
That's alright @simonmichael. Please consider it as a project donation. |
Hi, seems like transactions are not balances with multiple commodities, potentially due to rounding issue.
b.journal
Now if I want to see the balance in R, as per docs I will have to pass the and
--infer-market-prices
and--value=then,R
so that purchase/cost price is used.The -1.3 seems unexpected. The posting are completely balanced if I use round numbers.
b.journal
I have gone through the manual sections of Cost and Value reporting as well as the Track Investments cookbook multiple time and seems like the command line flags are correct.
Though I have been using hledger for many years, this is the first time I have to deal with foreign stocks and equity, so it is completely possible that I am doing something wrong.
Would appreciate any help.
Thanks!
Version Info
The text was updated successfully, but these errors were encountered: