New issue 255: Prices are not transitive
https://bitbucket.org/blais/beancount/issues/255/prices-are-not-transitive

Martin Michlmayr:

If a price pair MR/USD exists as well as USD/EUR, why can't beancount convert 
from MR to EUR directly?  i.e. why are prices not transitive?  (They are in 
ledger)

Example:

```
beancount> SELECT CONVERT(position, "USD") WHERE account ~ 'Test' AND currency 
~ 'MR'
convert_pos
-----------
 7.5000 USD
-7.5000 USD
beancount> SELECT CONVERT(position, "EUR") WHERE account ~ 'Test' AND currency 
~ 'USD'
       convert_position_c_        
----------------------------------
 8.130081300813008130081300813 EUR
-8.130081300813008130081300813 EUR
beancount> SELECT CONVERT(position, "EUR") WHERE account ~ 'Test' AND currency 
~ 'MR'
convert_
--------
 1000 MR
-1000 MR
beancount> SELECT CONVERT(CONVERT(position, "USD"), "EUR") WHERE account ~ 
'Test' AND currency ~ 'MR'
  convert_convert_position_c__c_  
----------------------------------
 6.097560975609756097560975610 EUR
-6.097560975609756097560975610 EUR
beancount> 
```

Test case:

```
2014-01-01 open Assets:Test

2018-03-20 * "Test"
  Assets:Test                1000 MR
  Assets:Test

2018-03-20 * "Test"
  Assets:Test                10 USD
  Assets:Test

2018-03-25 price EUR 1.23 USD
2018-03-25 price MR 0.0075 USD
```


-- 
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/20180325201140.16973.10838%40celery-worker-109.ash1.bb-inf.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to