Currency conversion in LibreOffice Calc?
Solution 1:
Without using a plugin, try using api.fixer.io:
=LEFT(RIGHT(WEBSERVICE("http://api.fixer.io/latest?symbols=EUR,GBP"),9),7)
This will retrieve something like this:
{"base":"EUR","date":"2017-08-17","rates":{"GBP":0.90895}}
and display this:
0.90895
The same technique would work with any other currency URL.
Regards
Edit 2020-09-15: The original URL provided is no longer valid. You can still get free rates at fixer.io, but you have to sign up for an api key. Here is an alternative place to get the data: https://exchangeratesapi.io/.
Solution 2:
There might be better ways but this is what I'm using:
First import the data from the website:
Insert -> "Link to External Data..." -> URL (eg https://forum.openoffice.org/en/forum/search.php?keywords=exchange+rates)
Then Define the cell containing the exchange rate:
Select cell (eg the JPY rate)
Insert -> Names -> Define... (eg euro_to_jpy)
Now you can use in formula:
=A2*euro_to_jpy
(see here for more: https://forum.openoffice.org/en/forum/search.php?keywords=exchange+rates)
Solution 3:
A slight generalization of doc's answer:
First, get currency data into a cell with the base currency of your choice (in this example, ILS is the base currency):
=WEBSERVICE("https://api.exchangeratesapi.io/latest?base=ILS")
Let's say that the output resides in cell I17. Now, the foreign-to-base ratio can be obtained by (example for GBP):
=MID(I17,SEARCH("GBP", $I$17)+5,9)
The number 9 here represents the number of characters of the exchange rate that are used (number of digits + decimal point). You may use more or less as required (number is concatenated, not rounded), but not more than 12. If you don't need high accuracy, it may be safer to use just 4 characters in case the api changes in the future.
[I used exchangeratesapi.io since it is a public service provided by the European Central Bank, which I think makes it unlikely to be discontinued]