package
0.200.1
Repository: https://github.com/invopop/gobl.git
Documentation: pkg.go.dev

# README

Currency Reference Data

Currency support in GOBL aims to cover most of the currencies in the world and provide methods to format and work with them.

Much of the inspiration for this package and source data in the /data/currency directory originally came from the excellent and widely used money gem in ruby. A few alterations to source data have been made.

Currencies around the world change more often than expected, please send a PR if you spot anything that is out of date, along with a link that references the source of the change.

# Functions

ByISONumber tries to find the currency definition by it's assigned ISO number.
CanConvertInto will check to see if the currency to be validated can be converted using one of the provided exchange rates.
Convert will convert the provided amount from one currency into another or return nil if no match can be found.
Definitions provides an array of all currency definitions ordered by priority.
Get provides the code's currency definition, or nil if no match found.
MatchExchangeRate will attempt to find the matching exchange rate that will convert from one currency into another.
WithDisambiguateSymbol will override the default symbol to use with one that is unique for the context.
WithNumeralSystem will override the default numeral system used to output numbers.

# Constants

United Arab Emirates Dirham (د.إ).
Afghan Afghani (؋).
Albanian Lek (L).
Armenian Dram (դր.).
Netherlands Antillean Gulden (ƒ).
Angolan Kwanza (Kz).
Argentine Peso ($).
Australian Dollar ($).
Aruban Florin (ƒ).
Azerbaijani Manat (₼).
Bosnia and Herzegovina Convertible Mark (КМ).
Barbadian Dollar ($).
Bitcoin Cash (₿).
Bangladeshi Taka (৳).
Bulgarian Lev (лв.).
Bahraini Dinar (د.ب).
Burundian Franc (Fr).
Bermudian Dollar ($).
Brunei Dollar ($).
Bolivian Boliviano (Bs.).
Brazilian Real (R$).
Bahamian Dollar ($).
Bitcoin (₿).
Bhutanese Ngultrum (Nu.).
Botswana Pula (P).
Belarusian Ruble (Br).
Belarusian Ruble (Br).
Belize Dollar ($).
Canadian Dollar ($).
Congolese Franc (Fr).
Swiss Franc (CHF).
Unidad de Fomento (UF).
Chilean Peso ($).
Chinese Renminbi Yuan Offshore (¥).
Chinese Renminbi Yuan (¥).
CodeEmpty is used when there is no code.
Colombian Peso ($).
Costa Rican Colón (₡).
Cuban Convertible Peso ($).
Cuban Peso ($).
Cape Verdean Escudo ($).
Czech Koruna (Kč).
DefaultCurrencyTemplate defines how to output currencies for most common use cases.
Djiboutian Franc (Fdj).
Danish Krone (kr.).
Dominican Peso ($).
Algerian Dinar (د.ج).
Egyptian Pound (ج.م).
Eritrean Nakfa (Nfk).
Ethiopian Birr (Br).
Euro (€).
Fijian Dollar ($).
Falkland Pound (£).
British Pound (£).
British Penny ().
Georgian Lari (₾).
Guernsey Pound (£).
Ghanaian Cedi (₵).
Gibraltar Pound (£).
Gambian Dalasi (D).
Guinean Franc (Fr).
Guatemalan Quetzal (Q).
Guyanese Dollar ($).
Hong Kong Dollar ($).
Honduran Lempira (L).
Haitian Gourde (G).
Hungarian Forint (Ft).
Indonesian Rupiah (Rp).
Israeli New Sheqel (₪).
Isle of Man Pound (£).
Indian Rupee (₹).
Iraqi Dinar (ع.د).
Iranian Rial (﷼).
Icelandic Króna (kr.).
Jersey Pound (£).
Jamaican Dollar ($).
Jordanian Dinar (د.ا).
Japanese Yen (¥).
Kenyan Shilling (KSh).
Kyrgyzstani Som (som).
Cambodian Riel (៛).
Comorian Franc (Fr).
North Korean Won (₩).
South Korean Won (₩).
Kuwaiti Dinar (د.ك).
Cayman Islands Dollar ($).
Kazakhstani Tenge (₸).
Lao Kip (₭).
Lebanese Pound (ل.ل).
Sri Lankan Rupee (₨).
Liberian Dollar ($).
Lesotho Loti (L).
Libyan Dinar (ل.د).
Moroccan Dirham (د.م.).
Moldovan Leu (L).
Malagasy Ariary (Ar).
Macedonian Denar (ден).
Myanmar Kyat (K).
Mongolian Tögrög (₮).
Macanese Pataca (P).
Mauritanian Ouguiya (UM).
Mauritian Rupee (₨).
Maldivian Rufiyaa (MVR).
Malawian Kwacha (MK).
Mexican Peso ($).
Malaysian Ringgit (RM).
Mozambican Metical (MTn).
Namibian Dollar ($).
Nigerian Naira (₦).
Nicaraguan Córdoba (C$).
Norwegian Krone (kr).
Nepalese Rupee (Rs.).
New Zealand Dollar ($).
Omani Rial (ر.ع.).
Panamanian Balboa (B/.).
Peruvian Sol (S/).
Papua New Guinean Kina (K).
Philippine Peso (₱).
Pakistani Rupee (₨).
Polish Złoty (zł).
Paraguayan Guaraní (₲).
Qatari Riyal (ر.ق).
Romanian Leu (Lei).
Serbian Dinar (РСД).
Russian Ruble (₽).
Rwandan Franc (FRw).
Saudi Riyal (ر.س).
Solomon Islands Dollar ($).
Seychellois Rupee (₨).
Sudanese Pound (£).
Swedish Krona (kr).
Singapore Dollar ($).
Saint Helenian Pound (£).
Slovak Koruna (Sk).
New Leone (Le).
Sierra Leonean Leone (Le).
Somali Shilling (Sh).
Surinamese Dollar ($).
South Sudanese Pound (£).
São Tomé and Príncipe Dobra (Db).
São Tomé and Príncipe Second Dobra (Db).
Salvadoran Colón (₡).
Syrian Pound (£S).
Swazi Lilangeni (E).
Thai Baht (฿).
Tajikistani Somoni (ЅМ).
Turkmenistani Manat (T).
Tunisian Dinar (د.ت).
Tongan Paʻanga (T$).
Turkish Lira (₺).
Trinidad and Tobago Dollar ($).
New Taiwan Dollar ($).
Tanzanian Shilling (Sh).
Ukrainian Hryvnia (₴).
Ugandan Shilling (USh).
United States Dollar ($).
USD Coin (USDC).
Uruguayan Peso ($U).
Uzbekistan Som (so'm).
Venezuelan Bolívar Soberano (Bs).
Vietnamese Đồng (₫).
Vanuatu Vatu (Vt).
Samoan Tala (T).
Central African Cfa Franc (CFA).
Silver (Troy Ounce) (oz t).
Gold (Troy Ounce) (oz t).
European Composite Unit ().
European Monetary Unit ().
European Unit of Account 9 ().
European Unit of Account 17 ().
East Caribbean Dollar ($).
Special Drawing Rights (SDR).
UIC Franc ().
West African Cfa Franc (Fr).
Palladium (oz t).
Cfp Franc (Fr).
Platinum (oz t).
Codes specifically reserved for testing purposes ().
Yemeni Rial (﷼).
South African Rand (R).
Zambian Kwacha (ZK).
Zambian Kwacha (K).

# Structs

An Amount represents a monetary value in a specific currency.
Def helps define how to format a currency as is based on the [Ruby Money Gem's](https://rubymoney.github.io/money/) Currency model.
ExchangeRate contains data on the rate to be used when converting amounts from one currency into another.

# Type aliases

Code is the ISO currency code.
FormatOption defines how to configure the formatter for common use cases and custom options.