Inferring unit cost from a total amount

43 views
Skip to first unread message

Samuel Lotz

unread,
Dec 30, 2021, 10:49:43 PM12/30/21
to Beancount
I have statements from an inheritance in which I know I have a certain number of shares of an asset but I don't know the cost these were obtained at and I was hoping to use something like the deprecated {{total cost}} syntax.

I found this issue https://github.com/beancount/beancount/issues/369
but I didn't quite understand how to use the alternative { # commodity} syntax and this isn't documented AFAICT.

Any ideas besides just calculating it manually (which in the end isn't that big of a deal for these few accounts).

Also not sure why that issue got closed as the deprecated syntax is still on the cheatsheet.

Ben Blount

unread,
Dec 30, 2021, 11:05:28 PM12/30/21
to Beancount
I'm not sure what level of deprecation the total cost syntax has, but using that seems like a pretty decent solution.
You can also do math just about anywhere where a number is accepted, so you could do this AFAIK:
Assets:Bank 100 FOO { 5000 / 100 USD }

--
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 on the web visit https://groups.google.com/d/msgid/beancount/a9175963-b48f-4b75-a8e7-6b0dfc903bb3n%40googlegroups.com.

Samuel Lotz

unread,
Dec 31, 2021, 11:33:52 AM12/31/21
to Beancount
Deprecation is noted from Blais in the issue. I also tested it and it didn't work.

That is also a good suggestion of doing the math inline, thank you.

Reply all
Reply to author
Forward
0 new messages