Money v1.3.2 Money.Currency View Source
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}
Link to this section 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
Returns all the currencies
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 Belarusian Ruble (BYN) currency
Convenience method to create a Money
object for the Belarusian 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 (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
Returns the exponent of the currency. An ArgumentError is raised if the currency doesn’t exist
Returns the exponent of the currency or nil if it doesn’t exist
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. An ArgumentError is raised if the currency doesn’t exist
Returns a map with the name and symbol of the currency or nil if it 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 (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. An ArgumentError is raised if the currency doesn’t exist
Returns the name of the currency or nil if it 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
Returns the sub_units_count of the currency. An ArgumentError is raised if the currency doesn’t exist
Convenience method to create a Money
object for the El Salvador Colon US Dollar (SVC) currency
Returns the symbol of the currency. An ArgumentError is raised if the currency doesn’t exist
Returns the symbol of the currency or nil if it 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
Link to this section Functions
Convenience method to create a Money
object for the UAE Dirham (AED) currency.
Example:
iex> Money.Currency.aed(100)
%Money{amount: 100, currency: :AED}
Convenience method to create a Money
object for the Afghani (AFN) currency.
Example:
iex> Money.Currency.afn(100)
%Money{amount: 100, currency: :AFN}
Returns all the currencies
Example:
iex> Money.Currency.all |> Map.fetch!(:GBP)
%{name: "Pound Sterling", symbol: "£", exponent: 2}
Convenience method to create a Money
object for the Lek (ALL) currency.
Example:
iex> Money.Currency.all(100)
%Money{amount: 100, currency: :ALL}
Convenience method to create a Money
object for the Armenian Dram (AMD) currency.
Example:
iex> Money.Currency.amd(100)
%Money{amount: 100, currency: :AMD}
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}
Convenience method to create a Money
object for the Kwanza (AOA) currency.
Example:
iex> Money.Currency.aoa(100)
%Money{amount: 100, currency: :AOA}
Convenience method to create a Money
object for the Argentine Peso (ARS) currency.
Example:
iex> Money.Currency.ars(100)
%Money{amount: 100, currency: :ARS}
Convenience method to create a Money
object for the Australian Dollar (AUD) currency.
Example:
iex> Money.Currency.aud(100)
%Money{amount: 100, currency: :AUD}
Convenience method to create a Money
object for the Aruban Guilder (AWG) currency.
Example:
iex> Money.Currency.awg(100)
%Money{amount: 100, currency: :AWG}
Convenience method to create a Money
object for the Azerbaijanian Manat (AZN) currency.
Example:
iex> Money.Currency.azn(100)
%Money{amount: 100, currency: :AZN}
Convenience method to create a Money
object for the Convertible Marks (BAM) currency.
Example:
iex> Money.Currency.bam(100)
%Money{amount: 100, currency: :BAM}
Convenience method to create a Money
object for the Barbados Dollar (BBD) currency.
Example:
iex> Money.Currency.bbd(100)
%Money{amount: 100, currency: :BBD}
Convenience method to create a Money
object for the Taka (BDT) currency.
Example:
iex> Money.Currency.bdt(100)
%Money{amount: 100, currency: :BDT}
Convenience method to create a Money
object for the Bulgarian Lev (BGN) currency.
Example:
iex> Money.Currency.bgn(100)
%Money{amount: 100, currency: :BGN}
Convenience method to create a Money
object for the Bahraini Dinar (BHD) currency.
Example:
iex> Money.Currency.bhd(100)
%Money{amount: 100, currency: :BHD}
Convenience method to create a Money
object for the Burundi Franc (BIF) currency.
Example:
iex> Money.Currency.bif(100)
%Money{amount: 100, currency: :BIF}
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}
Convenience method to create a Money
object for the Brunei Dollar (BND) currency.
Example:
iex> Money.Currency.bnd(100)
%Money{amount: 100, currency: :BND}
Convenience method to create a Money
object for the Boliviano Mvdol (BOB) currency.
Example:
iex> Money.Currency.bob(100)
%Money{amount: 100, currency: :BOB}
Convenience method to create a Money
object for the Boliviano Mvdol (BOV) currency.
Example:
iex> Money.Currency.bov(100)
%Money{amount: 100, currency: :BOV}
Convenience method to create a Money
object for the Brazilian Real (BRL) currency.
Example:
iex> Money.Currency.brl(100)
%Money{amount: 100, currency: :BRL}
Convenience method to create a Money
object for the Bahamian Dollar (BSD) currency.
Example:
iex> Money.Currency.bsd(100)
%Money{amount: 100, currency: :BSD}
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}
Convenience method to create a Money
object for the Pula (BWP) currency.
Example:
iex> Money.Currency.bwp(100)
%Money{amount: 100, currency: :BWP}
Convenience method to create a Money
object for the Belarusian Ruble (BYN) currency.
Example:
iex> Money.Currency.byn(100)
%Money{amount: 100, currency: :BYN}
Convenience method to create a Money
object for the Belarusian Ruble (BYR) currency.
Example:
iex> Money.Currency.byr(100)
%Money{amount: 100, currency: :BYR}
Convenience method to create a Money
object for the Belize Dollar (BZD) currency.
Example:
iex> Money.Currency.bzd(100)
%Money{amount: 100, currency: :BZD}
Convenience method to create a Money
object for the Canadian Dollar (CAD) currency.
Example:
iex> Money.Currency.cad(100)
%Money{amount: 100, currency: :CAD}
Convenience method to create a Money
object for the Congolese Franc (CDF) currency.
Example:
iex> Money.Currency.cdf(100)
%Money{amount: 100, currency: :CDF}
Convenience method to create a Money
object for the Swiss Franc (CHF) currency.
Example:
iex> Money.Currency.chf(100)
%Money{amount: 100, currency: :CHF}
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}
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}
Convenience method to create a Money
object for the Yuan Renminbi (CNY) currency.
Example:
iex> Money.Currency.cny(100)
%Money{amount: 100, currency: :CNY}
Convenience method to create a Money
object for the Colombian Peso (COP) currency.
Example:
iex> Money.Currency.cop(100)
%Money{amount: 100, currency: :COP}
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}
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}
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}
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}
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}
Convenience method to create a Money
object for the Czech Koruna (CZK) currency.
Example:
iex> Money.Currency.czk(100)
%Money{amount: 100, currency: :CZK}
Convenience method to create a Money
object for the Djibouti Franc (DJF) currency.
Example:
iex> Money.Currency.djf(100)
%Money{amount: 100, currency: :DJF}
Convenience method to create a Money
object for the Danish Krone (DKK) currency.
Example:
iex> Money.Currency.dkk(100)
%Money{amount: 100, currency: :DKK}
Convenience method to create a Money
object for the Dominican Peso (DOP) currency.
Example:
iex> Money.Currency.dop(100)
%Money{amount: 100, currency: :DOP}
Convenience method to create a Money
object for the Algerian Dinar (DZD) currency.
Example:
iex> Money.Currency.dzd(100)
%Money{amount: 100, currency: :DZD}
Convenience method to create a Money
object for the Kroon (EEK) currency.
Example:
iex> Money.Currency.eek(100)
%Money{amount: 100, currency: :EEK}
Convenience method to create a Money
object for the Egyptian Pound (EGP) currency.
Example:
iex> Money.Currency.egp(100)
%Money{amount: 100, currency: :EGP}
Convenience method to create a Money
object for the Nakfa (ERN) currency.
Example:
iex> Money.Currency.ern(100)
%Money{amount: 100, currency: :ERN}
Convenience method to create a Money
object for the Ethiopian Birr (ETB) currency.
Example:
iex> Money.Currency.etb(100)
%Money{amount: 100, currency: :ETB}
Convenience method to create a Money
object for the Euro (EUR) currency.
Example:
iex> Money.Currency.eur(100)
%Money{amount: 100, currency: :EUR}
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
Returns the exponent of the currency. An ArgumentError is raised if the currency doesn’t exist.
Example:
iex> Money.Currency.exponent!(:USD)
2
iex> Money.Currency.exponent!(:WRONG)
** (ArgumentError) currency WRONG doesn’t exist
Returns the exponent of the currency or nil if it doesn’t exist.
Example:
iex> Money.Currency.exponent(:USD)
2
iex> Money.Currency.exponent(:WRONG)
nil
Convenience method to create a Money
object for the Fiji Dollar (FJD) currency.
Example:
iex> Money.Currency.fjd(100)
%Money{amount: 100, currency: :FJD}
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}
Convenience method to create a Money
object for the Pound Sterling (GBP) currency.
Example:
iex> Money.Currency.gbp(100)
%Money{amount: 100, currency: :GBP}
Convenience method to create a Money
object for the Lari (GEL) currency.
Example:
iex> Money.Currency.gel(100)
%Money{amount: 100, currency: :GEL}
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: "$", exponent: 2}
iex> Money.Currency.get!(:WRONG)
** (ArgumentError) currency WRONG doesn’t exist
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: "$", exponent: 2}
iex> Money.Currency.get(:WRONG)
nil
Convenience method to create a Money
object for the Cedi (GHS) currency.
Example:
iex> Money.Currency.ghs(100)
%Money{amount: 100, currency: :GHS}
Convenience method to create a Money
object for the Gibraltar Pound (GIP) currency.
Example:
iex> Money.Currency.gip(100)
%Money{amount: 100, currency: :GIP}
Convenience method to create a Money
object for the Dalasi (GMD) currency.
Example:
iex> Money.Currency.gmd(100)
%Money{amount: 100, currency: :GMD}
Convenience method to create a Money
object for the Guinea Franc (GNF) currency.
Example:
iex> Money.Currency.gnf(100)
%Money{amount: 100, currency: :GNF}
Convenience method to create a Money
object for the Quetzal (GTQ) currency.
Example:
iex> Money.Currency.gtq(100)
%Money{amount: 100, currency: :GTQ}
Convenience method to create a Money
object for the Guyana Dollar (GYD) currency.
Example:
iex> Money.Currency.gyd(100)
%Money{amount: 100, currency: :GYD}
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}
Convenience method to create a Money
object for the Lempira (HNL) currency.
Example:
iex> Money.Currency.hnl(100)
%Money{amount: 100, currency: :HNL}
Convenience method to create a Money
object for the Croatian Kuna (HRK) currency.
Example:
iex> Money.Currency.hrk(100)
%Money{amount: 100, currency: :HRK}
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}
Convenience method to create a Money
object for the Forint (HUF) currency.
Example:
iex> Money.Currency.huf(100)
%Money{amount: 100, currency: :HUF}
Convenience method to create a Money
object for the Rupiah (IDR) currency.
Example:
iex> Money.Currency.idr(100)
%Money{amount: 100, currency: :IDR}
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}
Convenience method to create a Money
object for the Indian Rupee (INR) currency.
Example:
iex> Money.Currency.inr(100)
%Money{amount: 100, currency: :INR}
Convenience method to create a Money
object for the Iraqi Dinar (IQD) currency.
Example:
iex> Money.Currency.iqd(100)
%Money{amount: 100, currency: :IQD}
Convenience method to create a Money
object for the Iranian Rial (IRR) currency.
Example:
iex> Money.Currency.irr(100)
%Money{amount: 100, currency: :IRR}
Convenience method to create a Money
object for the Iceland Krona (ISK) currency.
Example:
iex> Money.Currency.isk(100)
%Money{amount: 100, currency: :ISK}
Convenience method to create a Money
object for the Jamaican Dollar (JMD) currency.
Example:
iex> Money.Currency.jmd(100)
%Money{amount: 100, currency: :JMD}
Convenience method to create a Money
object for the Jordanian Dinar (JOD) currency.
Example:
iex> Money.Currency.jod(100)
%Money{amount: 100, currency: :JOD}
Convenience method to create a Money
object for the Yen (JPY) currency.
Example:
iex> Money.Currency.jpy(100)
%Money{amount: 100, currency: :JPY}
Convenience method to create a Money
object for the Kenyan Shilling (KES) currency.
Example:
iex> Money.Currency.kes(100)
%Money{amount: 100, currency: :KES}
Convenience method to create a Money
object for the Som (KGS) currency.
Example:
iex> Money.Currency.kgs(100)
%Money{amount: 100, currency: :KGS}
Convenience method to create a Money
object for the Riel (KHR) currency.
Example:
iex> Money.Currency.khr(100)
%Money{amount: 100, currency: :KHR}
Convenience method to create a Money
object for the Comoro Franc (KMF) currency.
Example:
iex> Money.Currency.kmf(100)
%Money{amount: 100, currency: :KMF}
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}
Convenience method to create a Money
object for the Won (KRW) currency.
Example:
iex> Money.Currency.krw(100)
%Money{amount: 100, currency: :KRW}
Convenience method to create a Money
object for the Kuwaiti Dinar (KWD) currency.
Example:
iex> Money.Currency.kwd(100)
%Money{amount: 100, currency: :KWD}
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}
Convenience method to create a Money
object for the Tenge (KZT) currency.
Example:
iex> Money.Currency.kzt(100)
%Money{amount: 100, currency: :KZT}
Convenience method to create a Money
object for the Kip (LAK) currency.
Example:
iex> Money.Currency.lak(100)
%Money{amount: 100, currency: :LAK}
Convenience method to create a Money
object for the Lebanese Pound (LBP) currency.
Example:
iex> Money.Currency.lbp(100)
%Money{amount: 100, currency: :LBP}
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}
Convenience method to create a Money
object for the Liberian Dollar (LRD) currency.
Example:
iex> Money.Currency.lrd(100)
%Money{amount: 100, currency: :LRD}
Convenience method to create a Money
object for the Rand Loti (LSL) currency.
Example:
iex> Money.Currency.lsl(100)
%Money{amount: 100, currency: :LSL}
Convenience method to create a Money
object for the Lithuanian Litas (LTL) currency.
Example:
iex> Money.Currency.ltl(100)
%Money{amount: 100, currency: :LTL}
Convenience method to create a Money
object for the Latvian Lats (LVL) currency.
Example:
iex> Money.Currency.lvl(100)
%Money{amount: 100, currency: :LVL}
Convenience method to create a Money
object for the Libyan Dinar (LYD) currency.
Example:
iex> Money.Currency.lyd(100)
%Money{amount: 100, currency: :LYD}
Convenience method to create a Money
object for the Moroccan Dirham (MAD) currency.
Example:
iex> Money.Currency.mad(100)
%Money{amount: 100, currency: :MAD}
Convenience method to create a Money
object for the Moldovan Leu (MDL) currency.
Example:
iex> Money.Currency.mdl(100)
%Money{amount: 100, currency: :MDL}
Convenience method to create a Money
object for the Malagasy Ariary (MGA) currency.
Example:
iex> Money.Currency.mga(100)
%Money{amount: 100, currency: :MGA}
Convenience method to create a Money
object for the Denar (MKD) currency.
Example:
iex> Money.Currency.mkd(100)
%Money{amount: 100, currency: :MKD}
Convenience method to create a Money
object for the Kyat (MMK) currency.
Example:
iex> Money.Currency.mmk(100)
%Money{amount: 100, currency: :MMK}
Convenience method to create a Money
object for the Tugrik (MNT) currency.
Example:
iex> Money.Currency.mnt(100)
%Money{amount: 100, currency: :MNT}
Convenience method to create a Money
object for the Pataca (MOP) currency.
Example:
iex> Money.Currency.mop(100)
%Money{amount: 100, currency: :MOP}
Convenience method to create a Money
object for the Ouguiya (MRO) currency.
Example:
iex> Money.Currency.mro(100)
%Money{amount: 100, currency: :MRO}
Convenience method to create a Money
object for the Mauritius Rupee (MUR) currency.
Example:
iex> Money.Currency.mur(100)
%Money{amount: 100, currency: :MUR}
Convenience method to create a Money
object for the Rufiyaa (MVR) currency.
Example:
iex> Money.Currency.mvr(100)
%Money{amount: 100, currency: :MVR}
Convenience method to create a Money
object for the Kwacha (MWK) currency.
Example:
iex> Money.Currency.mwk(100)
%Money{amount: 100, currency: :MWK}
Convenience method to create a Money
object for the Mexican Peso (MXN) currency.
Example:
iex> Money.Currency.mxn(100)
%Money{amount: 100, currency: :MXN}
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}
Convenience method to create a Money
object for the Malaysian Ringgit (MYR) currency.
Example:
iex> Money.Currency.myr(100)
%Money{amount: 100, currency: :MYR}
Convenience method to create a Money
object for the Metical (MZN) currency.
Example:
iex> Money.Currency.mzn(100)
%Money{amount: 100, currency: :MZN}
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}
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
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
Convenience method to create a Money
object for the Naira (NGN) currency.
Example:
iex> Money.Currency.ngn(100)
%Money{amount: 100, currency: :NGN}
Convenience method to create a Money
object for the Cordoba Oro (NIO) currency.
Example:
iex> Money.Currency.nio(100)
%Money{amount: 100, currency: :NIO}
Convenience method to create a Money
object for the Norwegian Krone (NOK) currency.
Example:
iex> Money.Currency.nok(100)
%Money{amount: 100, currency: :NOK}
Convenience method to create a Money
object for the Nepalese Rupee (NPR) currency.
Example:
iex> Money.Currency.npr(100)
%Money{amount: 100, currency: :NPR}
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}
Convenience method to create a Money
object for the Rial Omani (OMR) currency.
Example:
iex> Money.Currency.omr(100)
%Money{amount: 100, currency: :OMR}
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}
Convenience method to create a Money
object for the Nuevo Sol (PEN) currency.
Example:
iex> Money.Currency.pen(100)
%Money{amount: 100, currency: :PEN}
Convenience method to create a Money
object for the Kina (PGK) currency.
Example:
iex> Money.Currency.pgk(100)
%Money{amount: 100, currency: :PGK}
Convenience method to create a Money
object for the Philippine Peso (PHP) currency.
Example:
iex> Money.Currency.php(100)
%Money{amount: 100, currency: :PHP}
Convenience method to create a Money
object for the Pakistan Rupee (PKR) currency.
Example:
iex> Money.Currency.pkr(100)
%Money{amount: 100, currency: :PKR}
Convenience method to create a Money
object for the Zloty (PLN) currency.
Example:
iex> Money.Currency.pln(100)
%Money{amount: 100, currency: :PLN}
Convenience method to create a Money
object for the Guarani (PYG) currency.
Example:
iex> Money.Currency.pyg(100)
%Money{amount: 100, currency: :PYG}
Convenience method to create a Money
object for the Qatari Rial (QAR) currency.
Example:
iex> Money.Currency.qar(100)
%Money{amount: 100, currency: :QAR}
Convenience method to create a Money
object for the New Leu (RON) currency.
Example:
iex> Money.Currency.ron(100)
%Money{amount: 100, currency: :RON}
Convenience method to create a Money
object for the Serbian Dinar (RSD) currency.
Example:
iex> Money.Currency.rsd(100)
%Money{amount: 100, currency: :RSD}
Convenience method to create a Money
object for the Russian Ruble (RUB) currency.
Example:
iex> Money.Currency.rub(100)
%Money{amount: 100, currency: :RUB}
Convenience method to create a Money
object for the Rwanda Franc (RWF) currency.
Example:
iex> Money.Currency.rwf(100)
%Money{amount: 100, currency: :RWF}
Convenience method to create a Money
object for the Saudi Riyal (SAR) currency.
Example:
iex> Money.Currency.sar(100)
%Money{amount: 100, currency: :SAR}
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}
Convenience method to create a Money
object for the Seychelles Rupee (SCR) currency.
Example:
iex> Money.Currency.scr(100)
%Money{amount: 100, currency: :SCR}
Convenience method to create a Money
object for the Sudanese Pound (SDG) currency.
Example:
iex> Money.Currency.sdg(100)
%Money{amount: 100, currency: :SDG}
Convenience method to create a Money
object for the Swedish Krona (SEK) currency.
Example:
iex> Money.Currency.sek(100)
%Money{amount: 100, currency: :SEK}
Convenience method to create a Money
object for the Singapore Dollar (SGD) currency.
Example:
iex> Money.Currency.sgd(100)
%Money{amount: 100, currency: :SGD}
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}
Convenience method to create a Money
object for the Leone (SLL) currency.
Example:
iex> Money.Currency.sll(100)
%Money{amount: 100, currency: :SLL}
Convenience method to create a Money
object for the Somali Shilling (SOS) currency.
Example:
iex> Money.Currency.sos(100)
%Money{amount: 100, currency: :SOS}
Convenience method to create a Money
object for the Surinam Dollar (SRD) currency.
Example:
iex> Money.Currency.srd(100)
%Money{amount: 100, currency: :SRD}
Convenience method to create a Money
object for the Dobra (STD) currency.
Example:
iex> Money.Currency.std(100)
%Money{amount: 100, currency: :STD}
Returns the sub_units_count of the currency. An ArgumentError is raised if the currency doesn’t exist.
Example:
iex> Money.Currency.sub_units_count!(:USD)
100
iex> Money.Currency.sub_units_count!(:JPY)
1
iex> Money.Currency.sub_units_count!(:WRONG)
** (ArgumentError) currency WRONG doesn’t exist
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}
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
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
Convenience method to create a Money
object for the Syrian Pound (SYP) currency.
Example:
iex> Money.Currency.syp(100)
%Money{amount: 100, currency: :SYP}
Convenience method to create a Money
object for the Lilangeni (SZL) currency.
Example:
iex> Money.Currency.szl(100)
%Money{amount: 100, currency: :SZL}
Convenience method to create a Money
object for the Baht (THB) currency.
Example:
iex> Money.Currency.thb(100)
%Money{amount: 100, currency: :THB}
Convenience method to create a Money
object for the Somoni (TJS) currency.
Example:
iex> Money.Currency.tjs(100)
%Money{amount: 100, currency: :TJS}
Convenience method to create a Money
object for the Manat (TMT) currency.
Example:
iex> Money.Currency.tmt(100)
%Money{amount: 100, currency: :TMT}
Convenience method to create a Money
object for the Tunisian Dinar (TND) currency.
Example:
iex> Money.Currency.tnd(100)
%Money{amount: 100, currency: :TND}
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
Convenience method to create a Money
object for the Pa’anga (TOP) currency.
Example:
iex> Money.Currency.top(100)
%Money{amount: 100, currency: :TOP}
Convenience method to create a Money
object for the Turkish Lira (TRY) currency.
Example:
iex> Money.Currency.try(100)
%Money{amount: 100, currency: :TRY}
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}
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}
Convenience method to create a Money
object for the Tanzanian Shilling (TZS) currency.
Example:
iex> Money.Currency.tzs(100)
%Money{amount: 100, currency: :TZS}
Convenience method to create a Money
object for the Hryvnia (UAH) currency.
Example:
iex> Money.Currency.uah(100)
%Money{amount: 100, currency: :UAH}
Convenience method to create a Money
object for the Uganda Shilling (UGX) currency.
Example:
iex> Money.Currency.ugx(100)
%Money{amount: 100, currency: :UGX}
Convenience method to create a Money
object for the US Dollar (USD) currency.
Example:
iex> Money.Currency.usd(100)
%Money{amount: 100, currency: :USD}
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}
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}
Convenience method to create a Money
object for the Uzbekistan Sum (UZS) currency.
Example:
iex> Money.Currency.uzs(100)
%Money{amount: 100, currency: :UZS}
Convenience method to create a Money
object for the Bolivar Fuerte (VEF) currency.
Example:
iex> Money.Currency.vef(100)
%Money{amount: 100, currency: :VEF}
Convenience method to create a Money
object for the Dong (VND) currency.
Example:
iex> Money.Currency.vnd(100)
%Money{amount: 100, currency: :VND}
Convenience method to create a Money
object for the Vatu (VUV) currency.
Example:
iex> Money.Currency.vuv(100)
%Money{amount: 100, currency: :VUV}
Convenience method to create a Money
object for the Tala (WST) currency.
Example:
iex> Money.Currency.wst(100)
%Money{amount: 100, currency: :WST}
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}
Convenience method to create a Money
object for the Silver (XAG) currency.
Example:
iex> Money.Currency.xag(100)
%Money{amount: 100, currency: :XAG}
Convenience method to create a Money
object for the Gold (XAU) currency.
Example:
iex> Money.Currency.xau(100)
%Money{amount: 100, currency: :XAU}
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}
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}
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}
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}
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}
Convenience method to create a Money
object for the SDR (XDR) currency.
Example:
iex> Money.Currency.xdr(100)
%Money{amount: 100, currency: :XDR}
Convenience method to create a Money
object for the UIC-Franc (XFU) currency.
Example:
iex> Money.Currency.xfu(100)
%Money{amount: 100, currency: :XFU}
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}
Convenience method to create a Money
object for the Palladium (XPD) currency.
Example:
iex> Money.Currency.xpd(100)
%Money{amount: 100, currency: :XPD}
Convenience method to create a Money
object for the CFP Franc (XPF) currency.
Example:
iex> Money.Currency.xpf(100)
%Money{amount: 100, currency: :XPF}
Convenience method to create a Money
object for the Platinum (XPT) currency.
Example:
iex> Money.Currency.xpt(100)
%Money{amount: 100, currency: :XPT}
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}
Convenience method to create a Money
object for the Yemeni Rial (YER) currency.
Example:
iex> Money.Currency.yer(100)
%Money{amount: 100, currency: :YER}
Convenience method to create a Money
object for the Rand (ZAR) currency.
Example:
iex> Money.Currency.zar(100)
%Money{amount: 100, currency: :ZAR}
Convenience method to create a Money
object for the Zambian Kwacha (ZMK) currency.
Example:
iex> Money.Currency.zmk(100)
%Money{amount: 100, currency: :ZMK}
Convenience method to create a Money
object for the Zimbabwe Dollar (ZWL) currency.
Example:
iex> Money.Currency.zwl(100)
%Money{amount: 100, currency: :ZWL}