New issue 234: cost leads to too much precision being shown in cost commodity
https://bitbucket.org/blais/beancount/issues/234/cost-leads-to-too-much-precision-being

Martin Michlmayr:

In the following example "32.0100 GBP" is shown as the balance of the account.  
I was only expecting 2 digits of precision after the . (i.e. 31.01).

```
2018-01-01 open Assets:Pension:NEST
2018-01-01 open Equity:Opening-Balance

option "inferred_tolerance_default" "GBP:0.01"

2018-01-01 * "Opening balance: NEST" #opening-balance
    Assets:Pension:NEST              57.62 GBP
    Equity:Opening-Balance

2018-01-02 * "NEST: Bought NEST Higher Risk Fund with December employee 
contributions"
    fund: "NESTHIGHER"
    Assets:Pension:NEST      11.7520 NESTHIGHER {2.1792 GBP, 2018-01-02}
    Assets:Pension:NEST                  ; -25.61 GBP
```

gives:

```
bean-report d.beancount bal -e Assets:Pension:NEST
Assets:Pension:NEST   32.0100 GBP
Assets:Pension:NEST   11.7520 NESTHIGHER
```

If I change the example to specify the price in the second posting, it is shown 
correctly:

```
2018-01-01 open Assets:Pension:NEST
2018-01-01 open Equity:Opening-Balance

option "inferred_tolerance_default" "GBP:0.01"

2018-01-01 * "Opening balance: NEST" #opening-balance
    Assets:Pension:NEST                              57.62 GBP
    Equity:Opening-Balance

2018-01-02 * "NEST: Bought NEST Higher Risk Fund with December employee 
contributions"
    fund: "NESTHIGHER"
    Assets:Pension:NEST         11.7520 NESTHIGHER {2.1792 GBP, 2018-01-02}
    Assets:Pension:NEST                              -25.61 GBP

```

leads to:

```
bean-report c.beancount bal -e Assets:Pension:NEST
Assets:Pension:NEST    32.01   GBP
Assets:Pension:NEST    11.7520 NESTHIGHER
```

However, giving the total purchase price explicitly doesn't help in all 
examples , e.g.:

```
2018-01-01 open Assets:Pension:NEST
2018-01-01 open Equity:Opening-Balance

option "inferred_tolerance_default" "GBP:0.01"

2018-01-01 * "Opening balance: NEST" #opening-balance
    Assets:Pension:NEST                     57.62 GBP
    Equity:Opening-Balance

2018-01-01 * "Opening balance: NEST Higher Risk Fund" #opening-balance
    fund: "NESTHIGHER"
    Assets:Pension:NEST      11.7230 NESTHIGHER {2.1846 GBP, 2017-12-14}
    Assets:Pension:NEST      11.7230 NESTHIGHER {2.1846 GBP, 2017-12-14}
    Assets:Pension:NEST      14.6526 NESTHIGHER {2.1846 GBP, 2017-12-14}
    Assets:Pension:NEST      14.6526 NESTHIGHER {2.1846 GBP, 2017-12-14}
    Equity:Opening-Balance             -115.24 GBP
```

This gives:

```
Assets:Pension:NEST     57.6200 GBP
Assets:Pension:NEST     52.7512 NESTHIGHER
```


-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20180314230041.26125.56648%40celery-worker-109.ash1.bb-inf.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to