New issue 278: Document the total cost syntax
https://bitbucket.org/blais/beancount/issues/278/document-the-total-cost-syntax
Martin Blais:
On Tue, Nov 1, 2016 at 2:38 AM, yegle <
cny...@gmail.com> wrote:
Hi Martin,
The # char in cost basis is a new thing to me and I don't think the syntax is mentioned in the language syntax doc
https://docs.google.com/document/d/1wAMVrKIA2qtRGmoVDSUBJGmYZSygUaR0uOMW1GV3YE0/edit# Could you document it there? You used `Assets:Account 100 MSFT {0 # 2000.00 USD}` in the example. I don't think the {{...}} syntax is mentioned in the doc as well.
I'll have to update the docs; taking note, thanks. This requires time I don't have for a couple of weeks.
Essentially, there are two numbers, e.g.
Assets:Investments 100 MSFT {42.00 # 9.95 USD}
The first (42.00) is the number of USD per share of MSFT.
The second is the total number of USD for the posting.
Thus, this posting's per-unit cost is (100 * 42.00 + 9.95) / 100 = 42.0995 USD / MSFT
Also, I'm sad to know AVERAGE booking is not available yet :-(
Progress doesn't always move in the order one wants. This is progress in the same direction, however.
If you'd like to have a go at it, here's where that would happen:
https://bitbucket.org/blais/beancount/src/fdd1b562fd53db239da1b0338a2634d05e1fe48e/src/python/beancount/parser/booking_full.py?at=default&fileviewer=file-view-default#booking_full.py-691
It turns out it needs a lot of unit testing to complete this, but at this point all the scaffolding around it is there and merged.
https://groups.google.com/d/msgid/beancount/CAFL5w3UCJTuT0PqzYQM-STwAfOPk5_LHFOOdDhtHDwzKMiEM4g%40mail.gmail.com?utm_medium=email&utm_source=footer
Responsible: blais