# Converting between currencies using a pair of currency codes

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?

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"] *)


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

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

UnitConvert["13.25 USD", "EUR"]


For all the currency names and codes:

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