New transactions changing past results (expected behavior? bug?)

82 views
Skip to first unread message

Dan Andersson

unread,
Jun 4, 2026, 9:54:02 AMJun 4
to Beancount
Hi

I'm on beancount 3.1.0

When I had only transactions for 2024 and earlier, I was seeing the correct amount "4.82831723 FOO" in my 2024 balance sheet (final 2024 balance of the FOO commodity). The next year 2025 was not involved anywhere.

After adding new transactions for 2025, my 2024 FOO balance sheet got modified to "4.8283 FOO". I lost information from the 2024 balance. No changes were made to 2024 and earlier transactions.

It seems like the 2025 transactions somehow changed the "accuracy" of the "FOO" commodity across the board (including in the past).

Any ideas what could have caused this? (I tried reproducing in simple test file, without success. My beancount file is in megabytes, so have no idea whats the source of problem)

Thanks,
DA

Dan Andersson

unread,
Jun 4, 2026, 10:54:30 AMJun 4
to Beancount
I "fixed" the problem by adding extra zeroes to all FOO amounts in 2025 transactions.

So the issue was, less decimal digits in 2025, somehow caused less decimal digits to appear in the 2024 balance sheet.

Could this be issue with only bean-query (and not main beancount engine itself)?

Is there ways to force bean-query to show e.g. 16 decimal points, always? (At least then, there won't be anything ambigous - always same reproducable decimal points)

Timothy Jesionowski

unread,
Jun 5, 2026, 10:21:02 AMJun 5
to bean...@googlegroups.com
I forget what the syntax is to specify how many decimal places explicitly, but it's inferred per commodity by the average (median? modal?) number of decimal places across all postings in that commodity. 



Sincerely,
Timothy Jesionowski

--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/beancount/86928220-088e-4ee6-b77b-ac676fdd8afan%40googlegroups.com.

Chary Ev2geny

unread,
Jun 6, 2026, 2:34:17 AMJun 6
to Beancount
I think this must be to do with the  display_precision.

The Beancount - Precision & Tolerances does not describe how it is calculated, but analyzing the code with AI  I came to the conclusion, that the most commonly used amount of decimal numbers for the specific currency across the entire ledger is used as a default  display_precision.

Which explains why adding new transactions may modify overall display prcision.

You can overwrite the inferred display precision:

As of 2025, there is a new configuration option that allows you to specify the intended precision of a particular currency by example, like this:

option "display_precision" "USD:0.01"
option "display_precision" "AUD:0.01"

Chary Ev2geny

unread,
Jun 6, 2026, 1:04:05 PMJun 6
to Beancount
I actually found this subject interesting to explore and have added the related section  to the  Interactive beanquery manual  ( it is   19.2 Appendix B: Display precision)  

It describes there in details and with examples how it all works.

The original scenario, which  Dan Andersson most likely has come across is also covered.
Reply all
Reply to author
Forward
0 new messages