On Tue, May 04, 2021 at 10:10:50AM -0700, Ben Blount wrote:
> There's a total cost syntax, it's double curlys {{ }}. The main downside of
> it: we have limited control over the precision for non-round numbers, so
> the costs can be long (and an exact match is required if you ever want to
> match by cost).
> 
> Also there's a # syntax for specifying an expense like a commission. I'm
> not sure if Martin intends either to be 'general availability' yet.
> 
> Here's an example from the tests of cost basis syntax (#)
> <https://github.com/beancount/beancount/blob/v2/beancount/parser/booking_full_test.py#L745>
> .
> Note you can't currently combine double curly total cost with the #
> function.
> 
> The # operator absorbs the commission into the basis:
> 2013-05-18 * ""
>   Assets:Investments:MSFT      10 MSFT { 200 # 9.95 USD }
>   Assets:Investments:Cash  -2009.95 USD
> 
> resolves to:
>    2013-05-18 *
>      Assets:Investments:MSFT        10 MSFT {200.995 USD, 2013-05-18}
>      Assets:Investments:Cash  -2009.95 USD

Ooh, the # syntax looks nice. It looks like it already works; at least
bean-check (beancount 2.3.3) accepts

  2000-01-01 * "buy"
    Assets:B 10 ACME { 10.00 # 6.00 USD }
    Assets:A

When I view it with fava, it just shows the cost as 10.60 USD. Is that
the whole story --- is { 10.00 # 6.00 USD } semantically identical to
{ 10.60 USD }?

{{ }} also seems to work, and thanks for the note about digits. I'll
make sure I can disambiguate lots some other way.


-- 
James

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20210504175218.qcazfwbqddkuj66r%40moth.falsifian.org.

Reply via email to