use core::scalar use units::currency # This module is currently not part of the prelude, because the 'exchange_rate("XYZ")' calls # are blocking. For the CLI application, we do however load this module on demand if one of # the identifiers below is. For the Web version, we asynchronously load exchange rates and then # pull in this module. fn exchange_rate(currency: String) -> Scalar @name("US dollar") @url("https://en.wikipedia.org/wiki/United_States_dollar") @aliases(dollars, USD, usd, $: short) unit dollar: Money = EUR / exchange_rate("USD") @name("Japanese yen") @url("https://en.wikipedia.org/wiki/Japanese_yen") @aliases(JPY, jpy, ¥: short, 円) unit yen: Money = EUR / exchange_rate("JPY") @name("Pound sterling") @url("https://en.wikipedia.org/wiki/Pound_sterling") @aliases(pound_sterling, GBP, gbp, £: short) unit british_pound: Money = EUR / exchange_rate("GBP") @name("Chinese yuan") @url("https://en.wikipedia.org/wiki/Renminbi") @aliases(yuan, CNY: short, cny, 元) unit renminbi: Money = EUR / exchange_rate("CNY") @name("Australian dollar") @url("https://en.wikipedia.org/wiki/Australian_dollar") @aliases(australian_dollars, AUD: short, aud, A$) unit australian_dollar: Money = EUR / exchange_rate("AUD") @name("Canadian dollar") @url("https://en.wikipedia.org/wiki/Canadian_dollar") @aliases(canadian_dollars, CAD: short, cad, C$, c$) unit canadian_dollar: Money = EUR / exchange_rate("CAD") @name("Swiss franc") @url("https://en.wikipedia.org/wiki/Swiss_franc") @aliases(swiss_francs, CHF: short, chf) unit swiss_franc: Money = EUR / exchange_rate("CHF") @name("Bulgarian lev") @url("https://en.wikipedia.org/wiki/Bulgarian_lev") @aliases(bulgarian_leva, BGN: short, bgn) unit bulgarian_lev: Money = EUR / exchange_rate("BGN") @name("Czech koruna") @url("https://en.wikipedia.org/wiki/Czech_koruna") @aliases(czech_korunas, CZK: short, czk, Kč) unit czech_koruna: Money = EUR / exchange_rate("CZK") @name("Hungarian forint") @url("https://en.wikipedia.org/wiki/Hungarian_forint") @aliases(hungarian_forints, HUF: short, huf, Ft) unit hungarian_forint: Money = EUR / exchange_rate("HUF") @name("Polish złoty") @url("https://en.wikipedia.org/wiki/Polish_złoty") @aliases(polish_zlotys, PLN: short, pln, zł) unit polish_zloty: Money = EUR / exchange_rate("PLN") @name("Romanian leu") @url("https://en.wikipedia.org/wiki/Romanian_leu") @aliases(romanian_leus, RON: short, ron, lei) unit romanian_leu: Money = EUR / exchange_rate("RON") @name("Turkish lira") @url("https://en.wikipedia.org/wiki/Turkish_lira") @aliases(turkish_liras, TRY: short, try, ₺) unit turkish_lira: Money = EUR / exchange_rate("TRY") @name("Brazilian real") @url("https://en.wikipedia.org/wiki/Brazilian_real") @aliases(brazilian_reals, BRL: short, brl, R$, r$) unit brazilian_real: Money = EUR / exchange_rate("BRL") @name("Hong Kong dollar") @url("https://en.wikipedia.org/wiki/Hong_Kong_dollar") @aliases(hong_kong_dollars, HKD: short, hkd, HK$, hk$) unit hong_kong_dollar: Money = EUR / exchange_rate("HKD") @name("Indonesian rupiah") @url("https://en.wikipedia.org/wiki/Indonesian_rupiah") @aliases(indonesian_rupiahs, IDR: short, idr, Rp) unit indonesian_rupiah: Money = EUR / exchange_rate("IDR") @name("Indian rupee") @url("https://en.wikipedia.org/wiki/Indian_rupee") @aliases(indian_rupees, INR: short, inr, ₹) unit indian_rupee: Money = EUR / exchange_rate("INR") @name("South Korean won") @url("https://en.wikipedia.org/wiki/South_Korean_won") @aliases(south_korean_wons, KRW: short, krw, ₩) unit south_korean_won: Money = EUR / exchange_rate("KRW") @name("Malaysian ringgit") @url("https://en.wikipedia.org/wiki/Malaysian_ringgit") @aliases(malaysian_ringgits, MYR: short, RM) unit malaysian_ringgit: Money = EUR / exchange_rate("MYR") @name("New Zealand dollar") @url("https://en.wikipedia.org/wiki/New_Zealand_dollar") @aliases(new_zealand_dollars, NZD: short, nzd, NZ$, nz$) unit new_zealand_dollar: Money = EUR / exchange_rate("NZD") @name("Philippine peso") @url("https://en.wikipedia.org/wiki/Philippine_peso") @aliases(philippine_pesos, PHP: short, php, ₱) unit philippine_peso: Money = EUR / exchange_rate("PHP") @name("Singapore dollar") @url("https://en.wikipedia.org/wiki/Singapore_dollar") @aliases(singapore_dollars, SGD: short, sgd, S$) unit singapore_dollar: Money = EUR / exchange_rate("SGD") @name("Thai baht") @url("https://en.wikipedia.org/wiki/Thai_baht") @aliases(thai_bahts, THB: short, thb, ฿) unit thai_baht: Money = EUR / exchange_rate("THB") @name("Danish krone") @url("https://en.wikipedia.org/wiki/Danish_krone") @aliases(danish_kroner, DKK: short, dkk) unit danish_krone: Money = EUR / exchange_rate("DKK") @name("Swedish krona") @url("https://en.wikipedia.org/wiki/Swedish_krona") @aliases(swedish_kronor, SEK: short, sek) unit swedish_krona: Money = EUR / exchange_rate("SEK") @name("Icelandic króna") @url("https://en.wikipedia.org/wiki/Icelandic_króna") @aliases(icelandic_krónur, icelandic_krona, icelandic_kronur, ISK: short, isk) unit icelandic_króna: Money = EUR / exchange_rate("ISK") @name("Norwegian krone") @url("https://en.wikipedia.org/wiki/Norwegian_krone") @aliases(norwegian_kroner, NOK: short, nok) unit norwegian_krone: Money = EUR / exchange_rate("NOK") @name("Israeli new shekel") @url("https://en.wikipedia.org/wiki/Israeli_new_shekel") @aliases(israeli_new_shekels, ILS: short, ils, ₪, NIS, nis) unit israeli_new_shekel: Money = EUR / exchange_rate("ILS") @name("South African rand") @url("https://en.wikipedia.org/wiki/South_African_rand") @aliases(ZAR: short, zar) unit south_african_rand: Money = EUR / exchange_rate("ZAR")