beancount throws exceptions for amounts over 1 billion

18 views
Skip to first unread message

Justus Pendleton

unread,
Dec 20, 2025, 8:49:24 PM (9 hours ago) Dec 20
to Beancount

# Allow precision for numbers as large as 1 billion in addition to
# the required number of fractional digits.
#
# TODO(blais): Review this to assess performance impact, and whether
# we could fold this outside a calling loop.
ctx.prec = num_fractional_digits + 9

The result is that any amount over 1 billion (e.g. in a bean-query) results in an exception:

decimal.InvalidOperation: [<class 'decimal.InvalidOperation'>]

For my personal usage I can just increase the 9 to a 12 or whatever I need but I wanted to ask if there's a better approach so I can try to submit an actual patch?

Cheers,
Justus
Reply all
Reply to author
Forward
0 new messages