Money v1.0.0-beta Money.Currency

Provides currency support to Money

Some useful helper methods include:

A helper function exists for each currency using the lowercase three-character currency code

Example:

iex> Money.Currency.usd(100)
%Money{amount: 100, currency: :USD}

Summary

Functions

Convenience method to create a Money object for the UAE Dirham (AED) currency

Convenience method to create a Money object for the Afghani (AFN) currency

Convenience method to create a Money object for the Lek (ALL) currency

Convenience method to create a Money object for the Armenian Dram (AMD) currency

Convenience method to create a Money object for the Netherlands Antillian Guilder (ANG) currency

Convenience method to create a Money object for the Kwanza (AOA) currency

Convenience method to create a Money object for the Argentine Peso (ARS) currency

Convenience method to create a Money object for the Australian Dollar (AUD) currency

Convenience method to create a Money object for the Aruban Guilder (AWG) currency

Convenience method to create a Money object for the Azerbaijanian Manat (AZN) currency

Convenience method to create a Money object for the Convertible Marks (BAM) currency

Convenience method to create a Money object for the Barbados Dollar (BBD) currency

Convenience method to create a Money object for the Taka (BDT) currency

Convenience method to create a Money object for the Bulgarian Lev (BGN) currency

Convenience method to create a Money object for the Bahraini Dinar (BHD) currency

Convenience method to create a Money object for the Burundi Franc (BIF) currency

Convenience method to create a Money object for the Bermudian Dollar (customarily known as Bermuda Dollar) (BMD) currency

Convenience method to create a Money object for the Brunei Dollar (BND) currency

Convenience method to create a Money object for the Boliviano Mvdol (BOB) currency

Convenience method to create a Money object for the Boliviano Mvdol (BOV) currency

Convenience method to create a Money object for the Brazilian Real (BRL) currency

Convenience method to create a Money object for the Bahamian Dollar (BSD) currency

Convenience method to create a Money object for the Indian Rupee Ngultrum (BTN) currency

Convenience method to create a Money object for the Pula (BWP) currency

Convenience method to create a Money object for the Belarussian Ruble (BYR) currency

Convenience method to create a Money object for the Belize Dollar (BZD) currency

Convenience method to create a Money object for the Canadian Dollar (CAD) currency

Convenience method to create a Money object for the Congolese Franc (CDF) currency

Convenience method to create a Money object for the Swiss Franc (CHF) currency

Convenience method to create a Money object for the Chilean Peso Unidades de fomento (CLF) currency

Convenience method to create a Money object for the Chilean Peso Unidades de fomento (CLP) currency

Convenience method to create a Money object for the Yuan Renminbi (CNY) currency

Convenience method to create a Money object for the Colombian Peso Unidad de Valor Real (COP) currency

Convenience method to create a Money object for the Colombian Peso Unidad de Valor Real (COU) currency

Convenience method to create a Money object for the Costa Rican Colon (CRC) currency

Convenience method to create a Money object for the Cuban Peso Peso Convertible (CUC) currency

Convenience method to create a Money object for the Cuban Peso Peso Convertible (CUP) currency

Convenience method to create a Money object for the Cape Verde Escudo (CVE) currency

Convenience method to create a Money object for the Czech Koruna (CZK) currency

Convenience method to create a Money object for the Djibouti Franc (DJF) currency

Convenience method to create a Money object for the Danish Krone (DKK) currency

Convenience method to create a Money object for the Dominican Peso (DOP) currency

Convenience method to create a Money object for the Algerian Dinar (DZD) currency

Convenience method to create a Money object for the Kroon (EEK) currency

Convenience method to create a Money object for the Egyptian Pound (EGP) currency

Convenience method to create a Money object for the Nakfa (ERN) currency

Convenience method to create a Money object for the Ethiopian Birr (ETB) currency

Convenience method to create a Money object for the Euro (EUR) currency

Returns true if a currency is defined

Convenience method to create a Money object for the Fiji Dollar (FJD) currency

Convenience method to create a Money object for the Falkland Islands Pound (FKP) currency

Convenience method to create a Money object for the Pound Sterling (GBP) currency

Convenience method to create a Money object for the Lari (GEL) currency

Returns a map with the name and symbol of the currency or nil if it doesn’t exist

Returns a map with the name and symbol of the currency. An ArgumentError is raised if the currency doesn’t exist

Convenience method to create a Money object for the Cedi (GHS) currency

Convenience method to create a Money object for the Gibraltar Pound (GIP) currency

Convenience method to create a Money object for the Dalasi (GMD) currency

Convenience method to create a Money object for the Guinea Franc (GNF) currency

Convenience method to create a Money object for the Quetzal (GTQ) currency

Convenience method to create a Money object for the Guyana Dollar (GYD) currency

Convenience method to create a Money object for the Hong Kong Dollar (HKD) currency

Convenience method to create a Money object for the Lempira (HNL) currency

Convenience method to create a Money object for the Croatian Kuna (HRK) currency

Convenience method to create a Money object for the Gourde US Dollar (HTG) currency

Convenience method to create a Money object for the Forint (HUF) currency

Convenience method to create a Money object for the Rupiah (IDR) currency

Convenience method to create a Money object for the New Israeli Sheqel (ILS) currency

Convenience method to create a Money object for the Indian Rupee (INR) currency

Convenience method to create a Money object for the Iraqi Dinar (IQD) currency

Convenience method to create a Money object for the Iranian Rial (IRR) currency

Convenience method to create a Money object for the Iceland Krona (ISK) currency

Convenience method to create a Money object for the Jamaican Dollar (JMD) currency

Convenience method to create a Money object for the Jordanian Dinar (JOD) currency

Convenience method to create a Money object for the Yen (JPY) currency

Convenience method to create a Money object for the Kenyan Shilling (KES) currency

Convenience method to create a Money object for the Som (KGS) currency

Convenience method to create a Money object for the Riel (KHR) currency

Convenience method to create a Money object for the Comoro Franc (KMF) currency

Convenience method to create a Money object for the North Korean Won (KPW) currency

Convenience method to create a Money object for the Won (KRW) currency

Convenience method to create a Money object for the Kuwaiti Dinar (KWD) currency

Convenience method to create a Money object for the Cayman Islands Dollar (KYD) currency

Convenience method to create a Money object for the Tenge (KZT) currency

Convenience method to create a Money object for the Kip (LAK) currency

Convenience method to create a Money object for the Lebanese Pound (LBP) currency

Convenience method to create a Money object for the Sri Lanka Rupee (LKR) currency

Convenience method to create a Money object for the Liberian Dollar (LRD) currency

Convenience method to create a Money object for the Rand Loti (LSL) currency

Convenience method to create a Money object for the Lithuanian Litas (LTL) currency

Convenience method to create a Money object for the Latvian Lats (LVL) currency

Convenience method to create a Money object for the Libyan Dinar (LYD) currency

Convenience method to create a Money object for the Moroccan Dirham (MAD) currency

Convenience method to create a Money object for the Moldovan Leu (MDL) currency

Convenience method to create a Money object for the Malagasy Ariary (MGA) currency

Convenience method to create a Money object for the Denar (MKD) currency

Convenience method to create a Money object for the Kyat (MMK) currency

Convenience method to create a Money object for the Tugrik (MNT) currency

Convenience method to create a Money object for the Pataca (MOP) currency

Convenience method to create a Money object for the Ouguiya (MRO) currency

Convenience method to create a Money object for the Mauritius Rupee (MUR) currency

Convenience method to create a Money object for the Rufiyaa (MVR) currency

Convenience method to create a Money object for the Kwacha (MWK) currency

Convenience method to create a Money object for the Mexican Peso Mexican Unidad de Inversion (UDI) (MXN) currency

Convenience method to create a Money object for the Mexican Peso Mexican Unidad de Inversion (UDI) (MXV) currency

Convenience method to create a Money object for the Malaysian Ringgit (MYR) currency

Convenience method to create a Money object for the Metical (MZN) currency

Convenience method to create a Money object for the Rand Namibia Dollar (NAD) currency

Returns the name of the currency or nil if it doesn’t exist

Returns the name of the currency. An ArgumentError is raised if the currency doesn’t exist

Convenience method to create a Money object for the Naira (NGN) currency

Convenience method to create a Money object for the Cordoba Oro (NIO) currency

Convenience method to create a Money object for the Norwegian Krone (NOK) currency

Convenience method to create a Money object for the Nepalese Rupee (NPR) currency

Convenience method to create a Money object for the New Zealand Dollar (NZD) currency

Convenience method to create a Money object for the Rial Omani (OMR) currency

Convenience method to create a Money object for the Balboa US Dollar (PAB) currency

Convenience method to create a Money object for the Nuevo Sol (PEN) currency

Convenience method to create a Money object for the Kina (PGK) currency

Convenience method to create a Money object for the Philippine Peso (PHP) currency

Convenience method to create a Money object for the Pakistan Rupee (PKR) currency

Convenience method to create a Money object for the Zloty (PLN) currency

Convenience method to create a Money object for the Guarani (PYG) currency

Convenience method to create a Money object for the Qatari Rial (QAR) currency

Convenience method to create a Money object for the New Leu (RON) currency

Convenience method to create a Money object for the Serbian Dinar (RSD) currency

Convenience method to create a Money object for the Russian Ruble (RUB) currency

Convenience method to create a Money object for the Rwanda Franc (RWF) currency

Convenience method to create a Money object for the Saudi Riyal (SAR) currency

Convenience method to create a Money object for the Solomon Islands Dollar (SBD) currency

Convenience method to create a Money object for the Seychelles Rupee (SCR) currency

Convenience method to create a Money object for the Sudanese Pound (SDG) currency

Convenience method to create a Money object for the Swedish Krona (SEK) currency

Convenience method to create a Money object for the Singapore Dollar (SGD) currency

Convenience method to create a Money object for the Saint Helena Pound (SHP) currency

Convenience method to create a Money object for the Leone (SLL) currency

Convenience method to create a Money object for the Somali Shilling (SOS) currency

Convenience method to create a Money object for the Surinam Dollar (SRD) currency

Convenience method to create a Money object for the Dobra (STD) currency

Convenience method to create a Money object for the El Salvador Colon US Dollar (SVC) currency

Returns the symbol of the currency or nil if it doesn’t exist

Returns the symbol of the currency. An ArgumentError is raised if the currency doesn’t exist

Convenience method to create a Money object for the Syrian Pound (SYP) currency

Convenience method to create a Money object for the Lilangeni (SZL) currency

Convenience method to create a Money object for the Baht (THB) currency

Convenience method to create a Money object for the Somoni (TJS) currency

Convenience method to create a Money object for the Manat (TMT) currency

Convenience method to create a Money object for the Tunisian Dinar (TND) currency

Returns the atom representation of the currency key An ArgumentError is raised if the currency doesn’t exist

Convenience method to create a Money object for the Pa’anga (TOP) currency

Convenience method to create a Money object for the Turkish Lira (TRY) currency

Convenience method to create a Money object for the Trinidad and Tobago Dollar (TTD) currency

Convenience method to create a Money object for the New Taiwan Dollar (TWD) currency

Convenience method to create a Money object for the Tanzanian Shilling (TZS) currency

Convenience method to create a Money object for the Hryvnia (UAH) currency

Convenience method to create a Money object for the Uganda Shilling (UGX) currency

Convenience method to create a Money object for the US Dollar (USD) currency

Convenience method to create a Money object for the Peso Uruguayo Uruguay Peso en Unidades Indexadas (UYI) currency

Convenience method to create a Money object for the Peso Uruguayo Uruguay Peso en Unidades Indexadas (UYU) currency

Convenience method to create a Money object for the Uzbekistan Sum (UZS) currency

Convenience method to create a Money object for the Bolivar Fuerte (VEF) currency

Convenience method to create a Money object for the Dong (VND) currency

Convenience method to create a Money object for the Vatu (VUV) currency

Convenience method to create a Money object for the Tala (WST) currency

Convenience method to create a Money object for the CFA Franc BEAC (XAF) currency

Convenience method to create a Money object for the Silver (XAG) currency

Convenience method to create a Money object for the Gold (XAU) currency

Convenience method to create a Money object for the Bond Markets Units European Composite Unit (EURCO) (XBA) currency

Convenience method to create a Money object for the European Monetary Unit (E.M.U.-6) (XBB) currency

Convenience method to create a Money object for the European Unit of Account 9(E.U.A.-9) (XBC) currency

Convenience method to create a Money object for the European Unit of Account 17(E.U.A.-17) (XBD) currency

Convenience method to create a Money object for the East Caribbean Dollar (XCD) currency

Convenience method to create a Money object for the SDR (XDR) currency

Convenience method to create a Money object for the UIC-Franc (XFU) currency

Convenience method to create a Money object for the CFA Franc BCEAO (XOF) currency

Convenience method to create a Money object for the Palladium (XPD) currency

Convenience method to create a Money object for the CFP Franc (XPF) currency

Convenience method to create a Money object for the Platinum (XPT) currency

Convenience method to create a Money object for the Codes specifically reserved for testing purposes (XTS) currency

Convenience method to create a Money object for the Yemeni Rial (YER) currency

Convenience method to create a Money object for the Rand (ZAR) currency

Convenience method to create a Money object for the Zambian Kwacha (ZMK) currency

Convenience method to create a Money object for the Zimbabwe Dollar (ZWL) currency

Functions

aed(amount)

Convenience method to create a Money object for the UAE Dirham (AED) currency.

Example:

iex> Money.Currency.aed(100)
%Money{amount: 100, currency: :AED}
afn(amount)

Convenience method to create a Money object for the Afghani (AFN) currency.

Example:

iex> Money.Currency.afn(100)
%Money{amount: 100, currency: :AFN}
all(amount)

Convenience method to create a Money object for the Lek (ALL) currency.

Example:

iex> Money.Currency.all(100)
%Money{amount: 100, currency: :ALL}
amd(amount)

Convenience method to create a Money object for the Armenian Dram (AMD) currency.

Example:

iex> Money.Currency.amd(100)
%Money{amount: 100, currency: :AMD}
ang(amount)

Convenience method to create a Money object for the Netherlands Antillian Guilder (ANG) currency.

Example:

iex> Money.Currency.ang(100)
%Money{amount: 100, currency: :ANG}
aoa(amount)

Convenience method to create a Money object for the Kwanza (AOA) currency.

Example:

iex> Money.Currency.aoa(100)
%Money{amount: 100, currency: :AOA}
ars(amount)

Convenience method to create a Money object for the Argentine Peso (ARS) currency.

Example:

iex> Money.Currency.ars(100)
%Money{amount: 100, currency: :ARS}
aud(amount)

Convenience method to create a Money object for the Australian Dollar (AUD) currency.

Example:

iex> Money.Currency.aud(100)
%Money{amount: 100, currency: :AUD}
awg(amount)

Convenience method to create a Money object for the Aruban Guilder (AWG) currency.

Example:

iex> Money.Currency.awg(100)
%Money{amount: 100, currency: :AWG}
azn(amount)

Convenience method to create a Money object for the Azerbaijanian Manat (AZN) currency.

Example:

iex> Money.Currency.azn(100)
%Money{amount: 100, currency: :AZN}
bam(amount)

Convenience method to create a Money object for the Convertible Marks (BAM) currency.

Example:

iex> Money.Currency.bam(100)
%Money{amount: 100, currency: :BAM}
bbd(amount)

Convenience method to create a Money object for the Barbados Dollar (BBD) currency.

Example:

iex> Money.Currency.bbd(100)
%Money{amount: 100, currency: :BBD}
bdt(amount)

Convenience method to create a Money object for the Taka (BDT) currency.

Example:

iex> Money.Currency.bdt(100)
%Money{amount: 100, currency: :BDT}
bgn(amount)

Convenience method to create a Money object for the Bulgarian Lev (BGN) currency.

Example:

iex> Money.Currency.bgn(100)
%Money{amount: 100, currency: :BGN}
bhd(amount)

Convenience method to create a Money object for the Bahraini Dinar (BHD) currency.

Example:

iex> Money.Currency.bhd(100)
%Money{amount: 100, currency: :BHD}
bif(amount)

Convenience method to create a Money object for the Burundi Franc (BIF) currency.

Example:

iex> Money.Currency.bif(100)
%Money{amount: 100, currency: :BIF}
bmd(amount)

Convenience method to create a Money object for the Bermudian Dollar (customarily known as Bermuda Dollar) (BMD) currency.

Example:

iex> Money.Currency.bmd(100)
%Money{amount: 100, currency: :BMD}
bnd(amount)

Convenience method to create a Money object for the Brunei Dollar (BND) currency.

Example:

iex> Money.Currency.bnd(100)
%Money{amount: 100, currency: :BND}
bob(amount)

Convenience method to create a Money object for the Boliviano Mvdol (BOB) currency.

Example:

iex> Money.Currency.bob(100)
%Money{amount: 100, currency: :BOB}
bov(amount)

Convenience method to create a Money object for the Boliviano Mvdol (BOV) currency.

Example:

iex> Money.Currency.bov(100)
%Money{amount: 100, currency: :BOV}
brl(amount)

Convenience method to create a Money object for the Brazilian Real (BRL) currency.

Example:

iex> Money.Currency.brl(100)
%Money{amount: 100, currency: :BRL}
bsd(amount)

Convenience method to create a Money object for the Bahamian Dollar (BSD) currency.

Example:

iex> Money.Currency.bsd(100)
%Money{amount: 100, currency: :BSD}
btn(amount)

Convenience method to create a Money object for the Indian Rupee Ngultrum (BTN) currency.

Example:

iex> Money.Currency.btn(100)
%Money{amount: 100, currency: :BTN}
bwp(amount)

Convenience method to create a Money object for the Pula (BWP) currency.

Example:

iex> Money.Currency.bwp(100)
%Money{amount: 100, currency: :BWP}
byr(amount)

Convenience method to create a Money object for the Belarussian Ruble (BYR) currency.

Example:

iex> Money.Currency.byr(100)
%Money{amount: 100, currency: :BYR}
bzd(amount)

Convenience method to create a Money object for the Belize Dollar (BZD) currency.

Example:

iex> Money.Currency.bzd(100)
%Money{amount: 100, currency: :BZD}
cad(amount)

Convenience method to create a Money object for the Canadian Dollar (CAD) currency.

Example:

iex> Money.Currency.cad(100)
%Money{amount: 100, currency: :CAD}
cdf(amount)

Convenience method to create a Money object for the Congolese Franc (CDF) currency.

Example:

iex> Money.Currency.cdf(100)
%Money{amount: 100, currency: :CDF}
chf(amount)

Convenience method to create a Money object for the Swiss Franc (CHF) currency.

Example:

iex> Money.Currency.chf(100)
%Money{amount: 100, currency: :CHF}
clf(amount)

Convenience method to create a Money object for the Chilean Peso Unidades de fomento (CLF) currency.

Example:

iex> Money.Currency.clf(100)
%Money{amount: 100, currency: :CLF}
clp(amount)

Convenience method to create a Money object for the Chilean Peso Unidades de fomento (CLP) currency.

Example:

iex> Money.Currency.clp(100)
%Money{amount: 100, currency: :CLP}
cny(amount)

Convenience method to create a Money object for the Yuan Renminbi (CNY) currency.

Example:

iex> Money.Currency.cny(100)
%Money{amount: 100, currency: :CNY}
cop(amount)

Convenience method to create a Money object for the Colombian Peso Unidad de Valor Real (COP) currency.

Example:

iex> Money.Currency.cop(100)
%Money{amount: 100, currency: :COP}
cou(amount)

Convenience method to create a Money object for the Colombian Peso Unidad de Valor Real (COU) currency.

Example:

iex> Money.Currency.cou(100)
%Money{amount: 100, currency: :COU}
crc(amount)

Convenience method to create a Money object for the Costa Rican Colon (CRC) currency.

Example:

iex> Money.Currency.crc(100)
%Money{amount: 100, currency: :CRC}
cuc(amount)

Convenience method to create a Money object for the Cuban Peso Peso Convertible (CUC) currency.

Example:

iex> Money.Currency.cuc(100)
%Money{amount: 100, currency: :CUC}
cup(amount)

Convenience method to create a Money object for the Cuban Peso Peso Convertible (CUP) currency.

Example:

iex> Money.Currency.cup(100)
%Money{amount: 100, currency: :CUP}
cve(amount)

Convenience method to create a Money object for the Cape Verde Escudo (CVE) currency.

Example:

iex> Money.Currency.cve(100)
%Money{amount: 100, currency: :CVE}
czk(amount)

Convenience method to create a Money object for the Czech Koruna (CZK) currency.

Example:

iex> Money.Currency.czk(100)
%Money{amount: 100, currency: :CZK}
djf(amount)

Convenience method to create a Money object for the Djibouti Franc (DJF) currency.

Example:

iex> Money.Currency.djf(100)
%Money{amount: 100, currency: :DJF}
dkk(amount)

Convenience method to create a Money object for the Danish Krone (DKK) currency.

Example:

iex> Money.Currency.dkk(100)
%Money{amount: 100, currency: :DKK}
dop(amount)

Convenience method to create a Money object for the Dominican Peso (DOP) currency.

Example:

iex> Money.Currency.dop(100)
%Money{amount: 100, currency: :DOP}
dzd(amount)

Convenience method to create a Money object for the Algerian Dinar (DZD) currency.

Example:

iex> Money.Currency.dzd(100)
%Money{amount: 100, currency: :DZD}
eek(amount)

Convenience method to create a Money object for the Kroon (EEK) currency.

Example:

iex> Money.Currency.eek(100)
%Money{amount: 100, currency: :EEK}
egp(amount)

Convenience method to create a Money object for the Egyptian Pound (EGP) currency.

Example:

iex> Money.Currency.egp(100)
%Money{amount: 100, currency: :EGP}
ern(amount)

Convenience method to create a Money object for the Nakfa (ERN) currency.

Example:

iex> Money.Currency.ern(100)
%Money{amount: 100, currency: :ERN}
etb(amount)

Convenience method to create a Money object for the Ethiopian Birr (ETB) currency.

Example:

iex> Money.Currency.etb(100)
%Money{amount: 100, currency: :ETB}
eur(amount)

Convenience method to create a Money object for the Euro (EUR) currency.

Example:

iex> Money.Currency.eur(100)
%Money{amount: 100, currency: :EUR}
exists?(currency)

Specs

exists?(Money.t | String.t | atom) :: boolean

Returns true if a currency is defined

Example:

iex> Money.Currency.exists?(:USD)
true
iex> Money.Currency.exists?("USD")
true
iex> Money.Currency.exists?(:WRONG)
false
fjd(amount)

Convenience method to create a Money object for the Fiji Dollar (FJD) currency.

Example:

iex> Money.Currency.fjd(100)
%Money{amount: 100, currency: :FJD}
fkp(amount)

Convenience method to create a Money object for the Falkland Islands Pound (FKP) currency.

Example:

iex> Money.Currency.fkp(100)
%Money{amount: 100, currency: :FKP}
gbp(amount)

Convenience method to create a Money object for the Pound Sterling (GBP) currency.

Example:

iex> Money.Currency.gbp(100)
%Money{amount: 100, currency: :GBP}
gel(amount)

Convenience method to create a Money object for the Lari (GEL) currency.

Example:

iex> Money.Currency.gel(100)
%Money{amount: 100, currency: :GEL}
get(currency)

Specs

get(Money.t | String.t | atom) :: map | nil

Returns a map with the name and symbol of the currency or nil if it doesn’t exist.

Example:

iex> Money.Currency.get(:USD)
%{name: "US Dollar", symbol: "$"}
iex> Money.Currency.get(:WRONG)
nil
get!(currency)

Specs

get!(Money.t | String.t | atom) :: map

Returns a map with the name and symbol of the currency. An ArgumentError is raised if the currency doesn’t exist.

Example:

iex> Money.Currency.get!(:USD)
%{name: "US Dollar", symbol: "$"}
iex> Money.Currency.get!(:WRONG)
** (ArgumentError) currency WRONG doesn’t exist
ghs(amount)

Convenience method to create a Money object for the Cedi (GHS) currency.

Example:

iex> Money.Currency.ghs(100)
%Money{amount: 100, currency: :GHS}
gip(amount)

Convenience method to create a Money object for the Gibraltar Pound (GIP) currency.

Example:

iex> Money.Currency.gip(100)
%Money{amount: 100, currency: :GIP}
gmd(amount)

Convenience method to create a Money object for the Dalasi (GMD) currency.

Example:

iex> Money.Currency.gmd(100)
%Money{amount: 100, currency: :GMD}
gnf(amount)

Convenience method to create a Money object for the Guinea Franc (GNF) currency.

Example:

iex> Money.Currency.gnf(100)
%Money{amount: 100, currency: :GNF}
gtq(amount)

Convenience method to create a Money object for the Quetzal (GTQ) currency.

Example:

iex> Money.Currency.gtq(100)
%Money{amount: 100, currency: :GTQ}
gyd(amount)

Convenience method to create a Money object for the Guyana Dollar (GYD) currency.

Example:

iex> Money.Currency.gyd(100)
%Money{amount: 100, currency: :GYD}
hkd(amount)

Convenience method to create a Money object for the Hong Kong Dollar (HKD) currency.

Example:

iex> Money.Currency.hkd(100)
%Money{amount: 100, currency: :HKD}
hnl(amount)

Convenience method to create a Money object for the Lempira (HNL) currency.

Example:

iex> Money.Currency.hnl(100)
%Money{amount: 100, currency: :HNL}
hrk(amount)

Convenience method to create a Money object for the Croatian Kuna (HRK) currency.

Example:

iex> Money.Currency.hrk(100)
%Money{amount: 100, currency: :HRK}
htg(amount)

Convenience method to create a Money object for the Gourde US Dollar (HTG) currency.

Example:

iex> Money.Currency.htg(100)
%Money{amount: 100, currency: :HTG}
huf(amount)

Convenience method to create a Money object for the Forint (HUF) currency.

Example:

iex> Money.Currency.huf(100)
%Money{amount: 100, currency: :HUF}
idr(amount)

Convenience method to create a Money object for the Rupiah (IDR) currency.

Example:

iex> Money.Currency.idr(100)
%Money{amount: 100, currency: :IDR}
ils(amount)

Convenience method to create a Money object for the New Israeli Sheqel (ILS) currency.

Example:

iex> Money.Currency.ils(100)
%Money{amount: 100, currency: :ILS}
inr(amount)

Convenience method to create a Money object for the Indian Rupee (INR) currency.

Example:

iex> Money.Currency.inr(100)
%Money{amount: 100, currency: :INR}
iqd(amount)

Convenience method to create a Money object for the Iraqi Dinar (IQD) currency.

Example:

iex> Money.Currency.iqd(100)
%Money{amount: 100, currency: :IQD}
irr(amount)

Convenience method to create a Money object for the Iranian Rial (IRR) currency.

Example:

iex> Money.Currency.irr(100)
%Money{amount: 100, currency: :IRR}
isk(amount)

Convenience method to create a Money object for the Iceland Krona (ISK) currency.

Example:

iex> Money.Currency.isk(100)
%Money{amount: 100, currency: :ISK}
jmd(amount)

Convenience method to create a Money object for the Jamaican Dollar (JMD) currency.

Example:

iex> Money.Currency.jmd(100)
%Money{amount: 100, currency: :JMD}
jod(amount)

Convenience method to create a Money object for the Jordanian Dinar (JOD) currency.

Example:

iex> Money.Currency.jod(100)
%Money{amount: 100, currency: :JOD}
jpy(amount)

Convenience method to create a Money object for the Yen (JPY) currency.

Example:

iex> Money.Currency.jpy(100)
%Money{amount: 100, currency: :JPY}
kes(amount)

Convenience method to create a Money object for the Kenyan Shilling (KES) currency.

Example:

iex> Money.Currency.kes(100)
%Money{amount: 100, currency: :KES}
kgs(amount)

Convenience method to create a Money object for the Som (KGS) currency.

Example:

iex> Money.Currency.kgs(100)
%Money{amount: 100, currency: :KGS}
khr(amount)

Convenience method to create a Money object for the Riel (KHR) currency.

Example:

iex> Money.Currency.khr(100)
%Money{amount: 100, currency: :KHR}
kmf(amount)

Convenience method to create a Money object for the Comoro Franc (KMF) currency.

Example:

iex> Money.Currency.kmf(100)
%Money{amount: 100, currency: :KMF}
kpw(amount)

Convenience method to create a Money object for the North Korean Won (KPW) currency.

Example:

iex> Money.Currency.kpw(100)
%Money{amount: 100, currency: :KPW}
krw(amount)

Convenience method to create a Money object for the Won (KRW) currency.

Example:

iex> Money.Currency.krw(100)
%Money{amount: 100, currency: :KRW}
kwd(amount)

Convenience method to create a Money object for the Kuwaiti Dinar (KWD) currency.

Example:

iex> Money.Currency.kwd(100)
%Money{amount: 100, currency: :KWD}
kyd(amount)

Convenience method to create a Money object for the Cayman Islands Dollar (KYD) currency.

Example:

iex> Money.Currency.kyd(100)
%Money{amount: 100, currency: :KYD}
kzt(amount)

Convenience method to create a Money object for the Tenge (KZT) currency.

Example:

iex> Money.Currency.kzt(100)
%Money{amount: 100, currency: :KZT}
lak(amount)

Convenience method to create a Money object for the Kip (LAK) currency.

Example:

iex> Money.Currency.lak(100)
%Money{amount: 100, currency: :LAK}
lbp(amount)

Convenience method to create a Money object for the Lebanese Pound (LBP) currency.

Example:

iex> Money.Currency.lbp(100)
%Money{amount: 100, currency: :LBP}
lkr(amount)

Convenience method to create a Money object for the Sri Lanka Rupee (LKR) currency.

Example:

iex> Money.Currency.lkr(100)
%Money{amount: 100, currency: :LKR}
lrd(amount)

Convenience method to create a Money object for the Liberian Dollar (LRD) currency.

Example:

iex> Money.Currency.lrd(100)
%Money{amount: 100, currency: :LRD}
lsl(amount)

Convenience method to create a Money object for the Rand Loti (LSL) currency.

Example:

iex> Money.Currency.lsl(100)
%Money{amount: 100, currency: :LSL}
ltl(amount)

Convenience method to create a Money object for the Lithuanian Litas (LTL) currency.

Example:

iex> Money.Currency.ltl(100)
%Money{amount: 100, currency: :LTL}
lvl(amount)

Convenience method to create a Money object for the Latvian Lats (LVL) currency.

Example:

iex> Money.Currency.lvl(100)
%Money{amount: 100, currency: :LVL}
lyd(amount)

Convenience method to create a Money object for the Libyan Dinar (LYD) currency.

Example:

iex> Money.Currency.lyd(100)
%Money{amount: 100, currency: :LYD}
mad(amount)

Convenience method to create a Money object for the Moroccan Dirham (MAD) currency.

Example:

iex> Money.Currency.mad(100)
%Money{amount: 100, currency: :MAD}
mdl(amount)

Convenience method to create a Money object for the Moldovan Leu (MDL) currency.

Example:

iex> Money.Currency.mdl(100)
%Money{amount: 100, currency: :MDL}
mga(amount)

Convenience method to create a Money object for the Malagasy Ariary (MGA) currency.

Example:

iex> Money.Currency.mga(100)
%Money{amount: 100, currency: :MGA}
mkd(amount)

Convenience method to create a Money object for the Denar (MKD) currency.

Example:

iex> Money.Currency.mkd(100)
%Money{amount: 100, currency: :MKD}
mmk(amount)

Convenience method to create a Money object for the Kyat (MMK) currency.

Example:

iex> Money.Currency.mmk(100)
%Money{amount: 100, currency: :MMK}
mnt(amount)

Convenience method to create a Money object for the Tugrik (MNT) currency.

Example:

iex> Money.Currency.mnt(100)
%Money{amount: 100, currency: :MNT}
mop(amount)

Convenience method to create a Money object for the Pataca (MOP) currency.

Example:

iex> Money.Currency.mop(100)
%Money{amount: 100, currency: :MOP}
mro(amount)

Convenience method to create a Money object for the Ouguiya (MRO) currency.

Example:

iex> Money.Currency.mro(100)
%Money{amount: 100, currency: :MRO}
mur(amount)

Convenience method to create a Money object for the Mauritius Rupee (MUR) currency.

Example:

iex> Money.Currency.mur(100)
%Money{amount: 100, currency: :MUR}
mvr(amount)

Convenience method to create a Money object for the Rufiyaa (MVR) currency.

Example:

iex> Money.Currency.mvr(100)
%Money{amount: 100, currency: :MVR}
mwk(amount)

Convenience method to create a Money object for the Kwacha (MWK) currency.

Example:

iex> Money.Currency.mwk(100)
%Money{amount: 100, currency: :MWK}
mxn(amount)

Convenience method to create a Money object for the Mexican Peso Mexican Unidad de Inversion (UDI) (MXN) currency.

Example:

iex> Money.Currency.mxn(100)
%Money{amount: 100, currency: :MXN}
mxv(amount)

Convenience method to create a Money object for the Mexican Peso Mexican Unidad de Inversion (UDI) (MXV) currency.

Example:

iex> Money.Currency.mxv(100)
%Money{amount: 100, currency: :MXV}
myr(amount)

Convenience method to create a Money object for the Malaysian Ringgit (MYR) currency.

Example:

iex> Money.Currency.myr(100)
%Money{amount: 100, currency: :MYR}
mzn(amount)

Convenience method to create a Money object for the Metical (MZN) currency.

Example:

iex> Money.Currency.mzn(100)
%Money{amount: 100, currency: :MZN}
nad(amount)

Convenience method to create a Money object for the Rand Namibia Dollar (NAD) currency.

Example:

iex> Money.Currency.nad(100)
%Money{amount: 100, currency: :NAD}
name(currency)

Specs

name(Money.t | String.t | atom) :: String.t

Returns the name of the currency or nil if it doesn’t exist.

Example:

iex> Money.Currency.name(:USD)
"US Dollar"
iex> Money.Currency.name(:WRONG)
nil
name!(currency)

Specs

name!(Money.t | String.t | atom) :: String.t

Returns the name of the currency. An ArgumentError is raised if the currency doesn’t exist.

Example:

iex> Money.Currency.name!(:USD)
"US Dollar"
iex> Money.Currency.name!(:WRONG)
** (ArgumentError) currency WRONG doesn’t exist
ngn(amount)

Convenience method to create a Money object for the Naira (NGN) currency.

Example:

iex> Money.Currency.ngn(100)
%Money{amount: 100, currency: :NGN}
nio(amount)

Convenience method to create a Money object for the Cordoba Oro (NIO) currency.

Example:

iex> Money.Currency.nio(100)
%Money{amount: 100, currency: :NIO}
nok(amount)

Convenience method to create a Money object for the Norwegian Krone (NOK) currency.

Example:

iex> Money.Currency.nok(100)
%Money{amount: 100, currency: :NOK}
npr(amount)

Convenience method to create a Money object for the Nepalese Rupee (NPR) currency.

Example:

iex> Money.Currency.npr(100)
%Money{amount: 100, currency: :NPR}
nzd(amount)

Convenience method to create a Money object for the New Zealand Dollar (NZD) currency.

Example:

iex> Money.Currency.nzd(100)
%Money{amount: 100, currency: :NZD}
omr(amount)

Convenience method to create a Money object for the Rial Omani (OMR) currency.

Example:

iex> Money.Currency.omr(100)
%Money{amount: 100, currency: :OMR}
pab(amount)

Convenience method to create a Money object for the Balboa US Dollar (PAB) currency.

Example:

iex> Money.Currency.pab(100)
%Money{amount: 100, currency: :PAB}
pen(amount)

Convenience method to create a Money object for the Nuevo Sol (PEN) currency.

Example:

iex> Money.Currency.pen(100)
%Money{amount: 100, currency: :PEN}
pgk(amount)

Convenience method to create a Money object for the Kina (PGK) currency.

Example:

iex> Money.Currency.pgk(100)
%Money{amount: 100, currency: :PGK}
php(amount)

Convenience method to create a Money object for the Philippine Peso (PHP) currency.

Example:

iex> Money.Currency.php(100)
%Money{amount: 100, currency: :PHP}
pkr(amount)

Convenience method to create a Money object for the Pakistan Rupee (PKR) currency.

Example:

iex> Money.Currency.pkr(100)
%Money{amount: 100, currency: :PKR}
pln(amount)

Convenience method to create a Money object for the Zloty (PLN) currency.

Example:

iex> Money.Currency.pln(100)
%Money{amount: 100, currency: :PLN}
pyg(amount)

Convenience method to create a Money object for the Guarani (PYG) currency.

Example:

iex> Money.Currency.pyg(100)
%Money{amount: 100, currency: :PYG}
qar(amount)

Convenience method to create a Money object for the Qatari Rial (QAR) currency.

Example:

iex> Money.Currency.qar(100)
%Money{amount: 100, currency: :QAR}
ron(amount)

Convenience method to create a Money object for the New Leu (RON) currency.

Example:

iex> Money.Currency.ron(100)
%Money{amount: 100, currency: :RON}
rsd(amount)

Convenience method to create a Money object for the Serbian Dinar (RSD) currency.

Example:

iex> Money.Currency.rsd(100)
%Money{amount: 100, currency: :RSD}
rub(amount)

Convenience method to create a Money object for the Russian Ruble (RUB) currency.

Example:

iex> Money.Currency.rub(100)
%Money{amount: 100, currency: :RUB}
rwf(amount)

Convenience method to create a Money object for the Rwanda Franc (RWF) currency.

Example:

iex> Money.Currency.rwf(100)
%Money{amount: 100, currency: :RWF}
sar(amount)

Convenience method to create a Money object for the Saudi Riyal (SAR) currency.

Example:

iex> Money.Currency.sar(100)
%Money{amount: 100, currency: :SAR}
sbd(amount)

Convenience method to create a Money object for the Solomon Islands Dollar (SBD) currency.

Example:

iex> Money.Currency.sbd(100)
%Money{amount: 100, currency: :SBD}
scr(amount)

Convenience method to create a Money object for the Seychelles Rupee (SCR) currency.

Example:

iex> Money.Currency.scr(100)
%Money{amount: 100, currency: :SCR}
sdg(amount)

Convenience method to create a Money object for the Sudanese Pound (SDG) currency.

Example:

iex> Money.Currency.sdg(100)
%Money{amount: 100, currency: :SDG}
sek(amount)

Convenience method to create a Money object for the Swedish Krona (SEK) currency.

Example:

iex> Money.Currency.sek(100)
%Money{amount: 100, currency: :SEK}
sgd(amount)

Convenience method to create a Money object for the Singapore Dollar (SGD) currency.

Example:

iex> Money.Currency.sgd(100)
%Money{amount: 100, currency: :SGD}
shp(amount)

Convenience method to create a Money object for the Saint Helena Pound (SHP) currency.

Example:

iex> Money.Currency.shp(100)
%Money{amount: 100, currency: :SHP}
sll(amount)

Convenience method to create a Money object for the Leone (SLL) currency.

Example:

iex> Money.Currency.sll(100)
%Money{amount: 100, currency: :SLL}
sos(amount)

Convenience method to create a Money object for the Somali Shilling (SOS) currency.

Example:

iex> Money.Currency.sos(100)
%Money{amount: 100, currency: :SOS}
srd(amount)

Convenience method to create a Money object for the Surinam Dollar (SRD) currency.

Example:

iex> Money.Currency.srd(100)
%Money{amount: 100, currency: :SRD}
std(amount)

Convenience method to create a Money object for the Dobra (STD) currency.

Example:

iex> Money.Currency.std(100)
%Money{amount: 100, currency: :STD}
svc(amount)

Convenience method to create a Money object for the El Salvador Colon US Dollar (SVC) currency.

Example:

iex> Money.Currency.svc(100)
%Money{amount: 100, currency: :SVC}
symbol(currency)

Specs

symbol(Money.t | String.t | atom) :: String.t

Returns the symbol of the currency or nil if it doesn’t exist.

Example:

iex> Money.Currency.symbol(:USD)
"$"
iex> Money.Currency.symbol(:WRONG)
nil
symbol!(currency)

Specs

symbol!(Money.t | String.t | atom) :: String.t

Returns the symbol of the currency. An ArgumentError is raised if the currency doesn’t exist.

Example:

iex> Money.Currency.symbol!(:USD)
"$"
iex> Money.Currency.symbol!(:WRONG)
** (ArgumentError) currency WRONG doesn’t exist
syp(amount)

Convenience method to create a Money object for the Syrian Pound (SYP) currency.

Example:

iex> Money.Currency.syp(100)
%Money{amount: 100, currency: :SYP}
szl(amount)

Convenience method to create a Money object for the Lilangeni (SZL) currency.

Example:

iex> Money.Currency.szl(100)
%Money{amount: 100, currency: :SZL}
thb(amount)

Convenience method to create a Money object for the Baht (THB) currency.

Example:

iex> Money.Currency.thb(100)
%Money{amount: 100, currency: :THB}
tjs(amount)

Convenience method to create a Money object for the Somoni (TJS) currency.

Example:

iex> Money.Currency.tjs(100)
%Money{amount: 100, currency: :TJS}
tmt(amount)

Convenience method to create a Money object for the Manat (TMT) currency.

Example:

iex> Money.Currency.tmt(100)
%Money{amount: 100, currency: :TMT}
tnd(amount)

Convenience method to create a Money object for the Tunisian Dinar (TND) currency.

Example:

iex> Money.Currency.tnd(100)
%Money{amount: 100, currency: :TND}
to_atom(currency)

Specs

to_atom(Money.t | String.t | atom) :: atom

Returns the atom representation of the currency key An ArgumentError is raised if the currency doesn’t exist.

Example:

iex> Money.Currency.to_atom("usd")
:USD
iex> Money.Currency.to_atom(:WRONG)
** (ArgumentError) currency WRONG doesn’t exist
top(amount)

Convenience method to create a Money object for the Pa’anga (TOP) currency.

Example:

iex> Money.Currency.top(100)
%Money{amount: 100, currency: :TOP}
try(amount)

Convenience method to create a Money object for the Turkish Lira (TRY) currency.

Example:

iex> Money.Currency.try(100)
%Money{amount: 100, currency: :TRY}
ttd(amount)

Convenience method to create a Money object for the Trinidad and Tobago Dollar (TTD) currency.

Example:

iex> Money.Currency.ttd(100)
%Money{amount: 100, currency: :TTD}
twd(amount)

Convenience method to create a Money object for the New Taiwan Dollar (TWD) currency.

Example:

iex> Money.Currency.twd(100)
%Money{amount: 100, currency: :TWD}
tzs(amount)

Convenience method to create a Money object for the Tanzanian Shilling (TZS) currency.

Example:

iex> Money.Currency.tzs(100)
%Money{amount: 100, currency: :TZS}
uah(amount)

Convenience method to create a Money object for the Hryvnia (UAH) currency.

Example:

iex> Money.Currency.uah(100)
%Money{amount: 100, currency: :UAH}
ugx(amount)

Convenience method to create a Money object for the Uganda Shilling (UGX) currency.

Example:

iex> Money.Currency.ugx(100)
%Money{amount: 100, currency: :UGX}
usd(amount)

Convenience method to create a Money object for the US Dollar (USD) currency.

Example:

iex> Money.Currency.usd(100)
%Money{amount: 100, currency: :USD}
uyi(amount)

Convenience method to create a Money object for the Peso Uruguayo Uruguay Peso en Unidades Indexadas (UYI) currency.

Example:

iex> Money.Currency.uyi(100)
%Money{amount: 100, currency: :UYI}
uyu(amount)

Convenience method to create a Money object for the Peso Uruguayo Uruguay Peso en Unidades Indexadas (UYU) currency.

Example:

iex> Money.Currency.uyu(100)
%Money{amount: 100, currency: :UYU}
uzs(amount)

Convenience method to create a Money object for the Uzbekistan Sum (UZS) currency.

Example:

iex> Money.Currency.uzs(100)
%Money{amount: 100, currency: :UZS}
vef(amount)

Convenience method to create a Money object for the Bolivar Fuerte (VEF) currency.

Example:

iex> Money.Currency.vef(100)
%Money{amount: 100, currency: :VEF}
vnd(amount)

Convenience method to create a Money object for the Dong (VND) currency.

Example:

iex> Money.Currency.vnd(100)
%Money{amount: 100, currency: :VND}
vuv(amount)

Convenience method to create a Money object for the Vatu (VUV) currency.

Example:

iex> Money.Currency.vuv(100)
%Money{amount: 100, currency: :VUV}
wst(amount)

Convenience method to create a Money object for the Tala (WST) currency.

Example:

iex> Money.Currency.wst(100)
%Money{amount: 100, currency: :WST}
xaf(amount)

Convenience method to create a Money object for the CFA Franc BEAC (XAF) currency.

Example:

iex> Money.Currency.xaf(100)
%Money{amount: 100, currency: :XAF}
xag(amount)

Convenience method to create a Money object for the Silver (XAG) currency.

Example:

iex> Money.Currency.xag(100)
%Money{amount: 100, currency: :XAG}
xau(amount)

Convenience method to create a Money object for the Gold (XAU) currency.

Example:

iex> Money.Currency.xau(100)
%Money{amount: 100, currency: :XAU}
xba(amount)

Convenience method to create a Money object for the Bond Markets Units European Composite Unit (EURCO) (XBA) currency.

Example:

iex> Money.Currency.xba(100)
%Money{amount: 100, currency: :XBA}
xbb(amount)

Convenience method to create a Money object for the European Monetary Unit (E.M.U.-6) (XBB) currency.

Example:

iex> Money.Currency.xbb(100)
%Money{amount: 100, currency: :XBB}
xbc(amount)

Convenience method to create a Money object for the European Unit of Account 9(E.U.A.-9) (XBC) currency.

Example:

iex> Money.Currency.xbc(100)
%Money{amount: 100, currency: :XBC}
xbd(amount)

Convenience method to create a Money object for the European Unit of Account 17(E.U.A.-17) (XBD) currency.

Example:

iex> Money.Currency.xbd(100)
%Money{amount: 100, currency: :XBD}
xcd(amount)

Convenience method to create a Money object for the East Caribbean Dollar (XCD) currency.

Example:

iex> Money.Currency.xcd(100)
%Money{amount: 100, currency: :XCD}
xdr(amount)

Convenience method to create a Money object for the SDR (XDR) currency.

Example:

iex> Money.Currency.xdr(100)
%Money{amount: 100, currency: :XDR}
xfu(amount)

Convenience method to create a Money object for the UIC-Franc (XFU) currency.

Example:

iex> Money.Currency.xfu(100)
%Money{amount: 100, currency: :XFU}
xof(amount)

Convenience method to create a Money object for the CFA Franc BCEAO (XOF) currency.

Example:

iex> Money.Currency.xof(100)
%Money{amount: 100, currency: :XOF}
xpd(amount)

Convenience method to create a Money object for the Palladium (XPD) currency.

Example:

iex> Money.Currency.xpd(100)
%Money{amount: 100, currency: :XPD}
xpf(amount)

Convenience method to create a Money object for the CFP Franc (XPF) currency.

Example:

iex> Money.Currency.xpf(100)
%Money{amount: 100, currency: :XPF}
xpt(amount)

Convenience method to create a Money object for the Platinum (XPT) currency.

Example:

iex> Money.Currency.xpt(100)
%Money{amount: 100, currency: :XPT}
xts(amount)

Convenience method to create a Money object for the Codes specifically reserved for testing purposes (XTS) currency.

Example:

iex> Money.Currency.xts(100)
%Money{amount: 100, currency: :XTS}
yer(amount)

Convenience method to create a Money object for the Yemeni Rial (YER) currency.

Example:

iex> Money.Currency.yer(100)
%Money{amount: 100, currency: :YER}
zar(amount)

Convenience method to create a Money object for the Rand (ZAR) currency.

Example:

iex> Money.Currency.zar(100)
%Money{amount: 100, currency: :ZAR}
zmk(amount)

Convenience method to create a Money object for the Zambian Kwacha (ZMK) currency.

Example:

iex> Money.Currency.zmk(100)
%Money{amount: 100, currency: :ZMK}
zwl(amount)

Convenience method to create a Money object for the Zimbabwe Dollar (ZWL) currency.

Example:

iex> Money.Currency.zwl(100)
%Money{amount: 100, currency: :ZWL}