Rounding

52 views
Skip to first unread message

Михаил Полыковский

unread,
Jan 10, 2025, 11:27:51 PMJan 10
to Beancount
Hi beancount community.

I’ve been using Beancount to manage my transactions and have encountered a small but frustrating issue. I have several currencies in my wallet. I enter some transactions in USD without any fractional part— just plain whole numbers. I don't use price syntax in transactions. But when I generate reports, the numbers show up with eight zeros after the decimal point, like 12.00000000 instead of 12.

beancount.png

I don’t have any "inferred_tolerance_default" settings or anything that I think might mess with this behavior.

What I’d love is to see my reports exactly the way I input the numbers — whole numbers with no fractions. Does anyone know how I can fix this? Is there some config setting or trick to make this happen?

I’ve searched through the group’s archives to see if this has come up before, but I couldn’t find an answer.

Thanks in advance for your help!


Martin Blais

unread,
Jan 11, 2025, 1:23:13 AMJan 11
to bean...@googlegroups.com
That's rendered in Fava?
Beancount will store the numbers as they were entered.




--
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/d8c4dc6b-d41b-4589-aa82-92bd20bdb260n%40googlegroups.com.

Marvin Ritter

unread,
Jan 11, 2025, 1:47:07 AMJan 11
to bean...@googlegroups.com
I encounter something similar before. I tracked it down to some logic in beancount (I believe it was beancount core not fava) that determines the display precision by tracking the number of decimals in entries in the entire ledger. And then outputs the most commonly used precision.

In my case I had a lot of "price" statements with ~8 decimals. I didn't have time to implement a proper fix and just reduced the number of "price" statements I keep. Maybe we can implement a setting for this

Glader

unread,
Jan 11, 2025, 9:37:19 AMJan 11
to bean...@googlegroups.com
I agree with you. I found this config in fava context

USD : sign=0 integer_max=6 fractional_common=8 fractional_max=8 "000000.00000000" "000000.00000000"

I didn't enter those values, and don't know, how to fix them. But this is more of a fava problem than a beancount one.

сб, 11 янв. 2025 г. в 04:23, Martin Blais <bl...@furius.ca>:

Glader

unread,
Jan 11, 2025, 9:58:34 AMJan 11
to bean...@googlegroups.com
Great, thank you very much. I cut fractions from prices, and it helped. It's not very useful, of course; I'd prefer to have precise prices. But numbers without fractions in reports are more important to me.

сб, 11 янв. 2025 г. в 04:47, Marvin Ritter <marvin...@gmail.com>:
Reply all
Reply to author
Forward
0 new messages