Open blais opened 6 years ago
Original comment by Patrick Ruckstuhl (GitHub: tarioch).
This is possible, I'm using this. It's the third argument. e.g. convert(position, "GBP", date)
Original comment by Martin Michlmayr (Bitbucket: tbm13, GitHub: tbm).
Thanks, Patrick. This issue is a documentation issue then since this isn't mention anywhere.
After adding explicit price entries, it works:
beancount> select date, position, convert(position, "GBP", date), balance where account ~ 'Expenses'
date position convert_po balance
---------- --------- ---------- ---------
2014-01-09 10.00 EUR 8.2830 GBP 10.00 EUR
2014-06-10 10.00 EUR 8.1060 GBP 20.00 EUR
2014-07-30 10.00 EUR 7.9140 GBP 30.00 EUR
The converted positions have 4 digits of precision: 8.1060. Is there a way to round this?
Original comment by Martin Blais (Bitbucket: blais, GitHub: blais).
The list of available functions is located in this file: https://bitbucket.org/blais/beancount/src/358d24867d12e7145f7fe2c321f3f809089051fa/beancount/query/query_env.py?at=default&fileviewer=file-view-default#query_env.py-638
I'd like to eventually generate a full list or serve it from the help.
Original report by Martin Michlmayr (Bitbucket: tbm13, GitHub: tbm).
I want to use CONVERT() to convert something to its historical cost (i.e. exchange rate on date of transaction, without later revaluation).
I don't think this is currently possible with beancount. Maybe CONVERT() can be extended to allow an optional DATE.
Example:
It uses the latest exchange rate (0.7825) for all transactions.