For balance sheet / income statement, can Beancount round to the nearest dollar?

52 views
Skip to first unread message

Dan Andersson

unread,
Feb 13, 2024, 6:13:31 AM2/13/24
to Beancount
Hi,

I'm currently using these commands to get

Balance sheet:

SELECT root(account, 2), sum(position)
  FROM OPEN ON 2023-01-01 CLOSE ON 2024-01-01 CLEAR
  WHERE not account ~ 'Income|Expenses'
  GROUP BY 1 ORDER BY 1;

Income statement:

SELECT root(account, 2), sum(position)
  FROM OPEN ON 2023-01-01 CLOSE ON 2024-01-01
  WHERE account ~ 'Income|Expenses'
  GROUP BY 1 ORDER BY 1;

Everything adds up (of course).
  • The problem is, when I round all the numbers to the nearest dollar, things understandably no longer add up (there's an error of plus/minus one dollar).
  • Is there a way to get Beancount to automatically round all the numbers first to the nearest dollar, and only then calculate any byproducts like Equity:Earnings and Equity:Conversions?

Thanks,
DA
Reply all
Reply to author
Forward
0 new messages