Issue #234: cost leads to too much precision being shown in cost commodity (blais/beancount)

10 views
Skip to first unread message

Martin Michlmayr

unread,
Mar 14, 2018, 7:00:44 PM3/14/18
to bean...@googlegroups.com
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
```


Reply all
Reply to author
Forward
0 new messages