5
$\begingroup$

Mathematica can convert currencies using real time data:

CurrencyConvert[Quantity[13.25, "USDollars"], "Euros"]

which gives

€10.8

Can I do this with two "currency codes"? I have a whole list of financial positions in various currencies (given by a series of codes like EUR, USD, KRW, GBP etc), I could convert these codes to things like "US dollars" and "Euros" but I have no clear list of what is what in the world of Mathematica units, except searching manually. Is there a way to do this?

$\endgroup$

2 Answers 2

3
$\begingroup$

You can use the "CurrencyName" interpreter, which can take the ISO currency name as an input, or FinancialData, or simply put the currency code as a unit inside Quantity.

CurrencyConvert[13.25 Interpreter["CurrencyName"]["USD"], 
 Interpreter["CurrencyName"]["EUR"]]
(* Quantity[12.192877938546935`, "Euros"] *)

13.25 FinancialData["USD/EUR"]
(* 12.1929 *)

CurrencyConvert[Quantity[13.25, "USD"], "EUR"]
(* Quantity[12.192877938546935`, "Euros"] *)
$\endgroup$
2
$\begingroup$

The following work on v12.2.0 on Win7-x64.

UnitConvert[Quantity[13.25, "USDollars"], "Euros"]

UnitConvert["13.25 USD", "EUR"]

enter image description here


For all the currency names and codes:

{#, CountryData[#, "CurrencyName"], 
    CountryData[#, "CurrencyCode"]} & /@ CountryData[] // 
 Short[#, 4] &
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.