formatting/precision when generating transactions

44 views
Skip to first unread message

Zurab Sajaia

unread,
Jul 7, 2025, 11:39:29 AM7/7/25
to Beancount
Hi all,

I've been just living with this annoyance for a while but perhaps there is a solution I'm missing?
When I import transactions for stock purchases where I usually have a round cash value, say 100 usd, and units of stock are fractional, i.e.
2025-07-07 * "buy ABC"
  assets:cash   -160 USD
  assets:abs  1.2019 ABS { 133.12 USD}

And this transaction doesn't balance because there is a rounding error. What I end up doing (the annoying part from above) is to add zeros to the cash amount - 160.00 USD and then the error disappears.

Is there a way better/right way to deal with such issues?

Thanks!
Zurab

Timothy Jesionowski

unread,
Jul 7, 2025, 12:30:19 PM7/7/25
to bean...@googlegroups.com
That's a normal consequence of how beancount tracks precision. Putting an integer amount of dollars implies exact precision, while putting N decimal zeros says the transaction should balance to N decimal places in that currency.



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/e8897673-ac6f-4256-a883-8e5bf25eeedcn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages