New issue 361: COST() ignores inferred_tolerance_default
https://bitbucket.org/blais/beancount/issues/361/cost-ignores-inferred_tolerance_default
Martin Michlmayr:
Let's take this example
```
2000-01-01 open Liabilities:Accounts-Payable
2000-01-01 open Expenses:Travel
2013-05-17 * "Test" "Train 1"
Expenses:Travel
Liabilities:Accounts-Payable -2.85 EUR {1.2817 USD, 2013-05-17}
2013-06-17 * "Test" "Train 2"
Expenses:Travel
Liabilities:Accounts-Payable -2.95 EUR {1.283 USD, 2013-05-17}
```
Now:
```
beancount> select date, position, balance where account ~ 'Expenses:Travel'
date position balance
---------- ---------- ----------
2013-05-17 3.6528 USD 3.6528 USD
2013-06-17 3.7848 USD 7.4376 USD
beancount>
```
So the precision is quite high. Ok, let's add
```
option "inferred_tolerance_default" "USD:0.01"
```
and now we get:
```
beancount> select date, position, balance where account ~ 'Expenses:Travel'
date position balance
---------- ---------- ----------
2013-05-17 3.65 USD 3.65 USD
2013-06-17 3.78 USD 7.43 USD
```
Ok, good.
This is for Expenses:. If we look at Liabilities, we should get the same
result.
But wait:
```
beancount> select date, COST(position) where account ~
'Liabilities:Accounts-Payable'
date cost_positi
---------- -----------
2013-05-17 -3.6528 USD
2013-06-17 -3.7848 USD
```
We still have all that precision.
And worse:
```
beancount> select SUM(COST(position)) where account ~
'Liabilities:Accounts-Payable'
sum_cost_po
-----------
-7.4376 USD
```
which after rounding is 7.44. But expenses were 7.43!
--
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/20190119012325.28874.12817%40celery-worker-111.ash1.bb-inf.net.
For more options, visit https://groups.google.com/d/optout.