Pecunia 0.9.0-alpha.22
Library using the ISO-4217 currency standard & a fixed monetary unit size
Loading...
Searching...
No Matches
pecunia Namespace Reference

Namespaces

namespace  internal
 
namespace  literals
 
namespace  math
 
namespace  rounders
 

Classes

struct  DomainError
 Represents an argument that is outside the realm of the purpose of a function. More...
 
class  Error
 A representation of a generalised software issue, complete with the location of the problem. More...
 
class  Expected
 Represents a result value that may either contain a valid value or an error state. Useful for error handling and propagating error states alongside valid results. Provides a way to work with results without using exceptions or nullable types. Ensures type safety by enforcing the presence of either a value or an error. More...
 
class  FloatingPoint
 Represents a safe type for working with floating-point operations. More...
 
struct  InvalidArgument
 Represents an argument that is invalid for the state of the function. More...
 
struct  LogicError
 Represents a flaw in the logic or a precondition of a function. More...
 
class  Minor
 Represents a monetary value in minor units, with associated currency code and sign/affinity. More...
 
class  Money
 A representation of a country’s currency supporting basic arithmetic usage and guaranteeing all operations succeed without a loss of precision, overflow, or underflow. More...
 
class  MoneyParts
 Represents the components of a monetary value separated into major, minor, sub-minor units and its associated currency. More...
 
struct  OutOfRange
 Represents an argument that is out of range for a container. More...
 
struct  OverflowError
 Represents a flaw that would trigger an overflow operation. More...
 
struct  PECUNIA_EXPORT
 Represents a globally accessible, inline constant placeholder for an unexpected error. It is used to handle or signify error states in a consistent and type-safe manner. More...
 
struct  RealNumber
 Represents the constituent parts of a real number. More...
 
struct  RuntimeError
 Represents a flaw that prevents a function from fulfilling its postcondition or purpose. More...
 
struct  UnderflowError
 Represents a flaw that would trigger an underflow operation. More...
 
struct  Unexpected
 Represents an unexpected error value. More...
 

Typedefs

using ConversionFunction
 A conversion function between two currencies where the first argument is the currency to convert from, the second argument is the currency to convert to, and giving back the conversion factor to get from the first currency to the second currency.
 
using FloatingPointRounderFunction
 A representation of a function that performs a rounding operation upon a real number. This function must take a number, the number of digits after the whole number to round, and giving back the rounded number.
 
using RounderFunction
 A representation of a function that performs a rounding operation upon a money storage type. This function must take first the major and minor amount value stored together, then the number of digits in the minor unit, finally the number of digits after the whole number to round, and giving back the rounded number with the major and minor amount stored together.
 

Functions

template<typename ValueType , typename ErrorType >
const Expected< ValueType, ErrorType > & apply (const Expected< ValueType, ErrorType > &expected, const std::function< void(const ValueType &)> &matchesValueType, const std::function< void(const ErrorType &)> &matchesErrorType)
 Applies a specified operation based on the state of the provided object.
 
template<typename ValueType , typename ErrorType >
Expected< ValueType, ErrorType > & apply (Expected< ValueType, ErrorType > &expected, const std::function< void(ValueType &)> &matchesValueType, const std::function< void(ErrorType &)> &matchesErrorType)
 Applies a specified operation based on the state of the provided object.
 
PECUNIA_EXPORT std::string copyright () noexcept
 Provides the copyright of the library.
 
PECUNIA_EXPORT std::vector< std::string > countriesUsing (const Currency &code) noexcept
 Looks-up the countries which are using a given currency.
 
PECUNIA_EXPORT std::string currencyName (const Currency &code) noexcept
 Looks-up the name of a currency using a given currency code.
 
PECUNIA_EXPORT std::optional< std::string > currencySymbol (const Currency &code) noexcept
 Provides the native currency symbol used by a currency code. N.B. currency symbols are shared by others and are therefore cannot be unique.
 
PECUNIA_EXPORT std::string description () noexcept
 Provides the description of the library.
 
PECUNIA_EXPORT std::optional< FloatingPointexchangeRate (const Currency &from, const Currency &to) noexcept
 Retrieves the exchange rate for currency conversion.
 
PECUNIA_EXPORT std::ios_base & isocode (std::ios_base &stream)
 A stream manipulator that configures the currency representation in formatted output to use the ISO-4217 code instead of the currency symbol.
 
PECUNIA_EXPORT std::ios_base & leading (std::ios_base &stream)
 A stream manipulator that ensures the currency indicator is displayed before the value in formatted output.
 
PECUNIA_EXPORT std::string licence () noexcept
 Provides the licence of the library.
 
PECUNIA_EXPORT std::string metadataVersion () noexcept
 Provides the semantic version with the metadata of the library.
 
PECUNIA_EXPORT std::uint8_t minorUnitDigits (const Currency &code) noexcept
 Provides the number of digits used by the minor currency unit using the currency's ISO exponent.
 
PECUNIA_EXPORT std::ios_base & nonspaced (std::ios_base &stream)
 A stream manipulator that disables spacing between the currency symbol, and the numeric value in formatted output.
 
PECUNIA_EXPORT bool operator!= (const MoneyParts &lhs, const MoneyParts &rhs)
 General inequality operator.
 
PECUNIA_EXPORT Money operator* (const FloatingPointBase &lhs, const Money &rhs)
 The multiplicative operator without any loss of precision. This only supports as many digits as minor digits.
 
PECUNIA_EXPORT FloatingPoint operator* (const FloatingPointBase multiplicand, const FloatingPoint &multiplier)
 Calculates the multiplication operation.
 
PECUNIA_EXPORT Money operator* (const std::int16_t &lhs, const Money &rhs)
 The multiplicative operator without any loss of precision.
 
PECUNIA_EXPORT Money operator* (const std::int32_t &lhs, const Money &rhs)
 The multiplicative operator without any loss of precision.
 
PECUNIA_EXPORT Money operator* (const std::int64_t &lhs, const Money &rhs)
 The multiplicative operator without any loss of precision.
 
PECUNIA_EXPORT Money operator* (const std::int8_t &lhs, const Money &rhs)
 The multiplicative operator without any loss of precision.
 
PECUNIA_EXPORT FloatingPoint operator/ (const FloatingPointBase dividend, const FloatingPoint &divisor)
 Calculates the division operation.
 
PECUNIA_EXPORT bool operator< (const FloatingPointBase lhs, const FloatingPoint &rhs)
 Relationship operator checking the less-than status.
 
PECUNIA_EXPORT bool operator< (const MoneyParts &lhs, const MoneyParts &rhs)
 Compares two objects to determine if the first is less than the second, considering both their currency codes and monetary values.
 
PECUNIA_EXPORT std::ostream & operator<< (std::ostream &stream, const Currency &code) noexcept
 Performs the stream insertion for displaying the currency code in the ISO-4217 form.
 
PECUNIA_EXPORT std::ostream & operator<< (std::ostream &stream, const Money &m)
 Stream Insertion Operator. By default, the form will be in the locale’s monetary format with no spaces, the ISO code, and trailing the value, e.g. a U.S.A. locale with value of one dollar and twenty-three cents would appear as 1.23USD.
 
PECUNIA_EXPORT bool operator== (const MoneyParts &lhs, const MoneyParts &rhs)
 General equality operator.
 
PECUNIA_EXPORT bool operator> (const FloatingPointBase lhs, const FloatingPoint &rhs)
 Relationship operator checking the greater-than status.
 
PECUNIA_EXPORT std::istream & operator>> (std::istream &stream, Money &m)
 Stream Extraction Operator. The monetary amount will be read in using the locale’s setting for reading in money. The currency code is required and must be in all upper-case letters.
 
PECUNIA_EXPORT const std::string & publishedOn () noexcept
 The date the codes were published by the ISO.
 
PECUNIA_EXPORT void setUpLibrary ()
 Sets up the behaviour for the library, ensuring a suitable default environment is established for monetary computations.
 
PECUNIA_EXPORT void setUpLibrary (const ConversionFunction &converterFunctor)
 Sets up currency-related behaviours for the library. This ensures the proper environment is established for currency operations.
 
PECUNIA_EXPORT void setUpLibrary (const ConversionFunction &converterFunctor, const std::string &localeName)
 Sets up currency-related behaviours for the library. This ensures the proper environment is established for currency operations.
 
PECUNIA_EXPORT void setUpLibrary (const std::string &localeName)
 Sets up currency-related behaviours for the library. This ensures the proper environment is established for currency operations.
 
template<typename ContainerType >
void sort (ContainerType &container, const std::function< void(typename ContainerType::value_type &, typename ContainerType::value_type &) > &swaperator=pecunia::swap)
 Sorts the container using a less-than comparison operator. The sort is not stable.
 
PECUNIA_EXPORT std::ios_base & spaced (std::ios_base &stream)
 A stream manipulator that ensures a space is inserted appropriately between components in formatted monetary output.
 
PECUNIA_EXPORT MoneyParts split (const std::string &amount)
 Splits a string into the various parts of a monetary value. Performance wise it will favour strings with a trailing currency. Uses the systems locale to determine the major and minor separator. Valid forms are:
 
PECUNIA_EXPORT MoneyParts split (const std::string &amount, const char majorMinorSeparator)
 Splits a string into the various parts of a monetary value. Performance wise it will favour strings with a trailing currency. Valid forms are:
 
PECUNIA_EXPORT void swap (Money &lhs, Money &rhs)
 Exchanges two monetary objects without any conversion operation performed.
 
PECUNIA_EXPORT std::ios_base & symbol (std::ios_base &stream)
 Sets the stream to apply a currency symbol formatting behaviour during output operations.
 
PECUNIA_EXPORT Currency toCurrency (const std::string &code)
 Converts a given string representation of a currency code to its corresponding strong object form.
 
PECUNIA_EXPORT MinorUnit toMinorUnit (const MinorUnit &minor, const Currency &code)
 Converts a truncated minor value into a minor and sub-minor value, i.e. given a value of USD 25 cents it'll convert it into "2500".
 
enum PECUNIA_EXPORT PECUNIA_EXPORT std::string toStdString (const Currency &code) noexcept
 Converts from a strongly-typed ISO code to a weak string form.
 
PECUNIA_EXPORT std::string toStdString (const Money &m)
 Converts the monetary representation into a string from. The format of the string representation is the amount followed by a space, and the currency code.
 
PECUNIA_EXPORT std::ios_base & trailing (std::ios_base &stream)
 A stream manipulator that positions the currency indicator after the monetary value in formatted output.
 
PECUNIA_EXPORT std::string url () noexcept
 Provides the URL of the library.
 
PECUNIA_EXPORT std::string version () noexcept
 Provides the semantic version without the metadata of the library.
 

Variables

enum PECUNIA_EXPORT AFN = 971
 The currency code for the "Afghani" used in: AFGHANISTAN.
 
enum PECUNIA_EXPORT ALL = 8
 The currency code for the "Lek" used in: ALBANIA.
 
PECUNIA_EXPORT const std::array< Currency, 179 > allCurrencies
 A container of every currency code known. The codes are sorted in alphabetical order.
 
enum PECUNIA_EXPORT AMD = 51
 The currency code for the "Armenian Dram" used in: ARMENIA.
 
enum PECUNIA_EXPORT AOA = 973
 The currency code for the "Kwanza" used in: ANGOLA.
 
enum PECUNIA_EXPORT ARS = 32
 The currency code for the "Argentine Peso" used in: ARGENTINA.
 
enum PECUNIA_EXPORT AUD = 36
 The currency code for the "Australian Dollar" used in: AUSTRALIA; CHRISTMAS ISLAND; COCOS (KEELING) ISLANDS (THE); HEARD ISLAND AND McDONALD ISLANDS; KIRIBATI; NAURU; NORFOLK ISLAND; TUVALU.
 
enum PECUNIA_EXPORT AWG = 533
 The currency code for the "Aruban Florin" used in: ARUBA.
 
enum PECUNIA_EXPORT AZN = 944
 The currency code for the "Azerbaijan Manat" used in: AZERBAIJAN.
 
enum PECUNIA_EXPORT BAM = 977
 The currency code for the "Convertible Mark" used in: BOSNIA AND HERZEGOVINA.
 
enum PECUNIA_EXPORT BBD = 52
 The currency code for the "Barbados Dollar" used in: BARBADOS.
 
enum PECUNIA_EXPORT BDT = 50
 The currency code for the "Taka" used in: BANGLADESH.
 
enum PECUNIA_EXPORT BGN = 975
 The currency code for the "Bulgarian Lev" used in: BULGARIA.
 
enum PECUNIA_EXPORT BHD = 48
 The currency code for the "Bahraini Dinar" used in: BAHRAIN.
 
enum PECUNIA_EXPORT BIF = 108
 The currency code for the "Burundi Franc" used in: BURUNDI.
 
enum PECUNIA_EXPORT BMD = 60
 The currency code for the "Bermudian Dollar" used in: BERMUDA.
 
enum PECUNIA_EXPORT BND = 96
 The currency code for the "Brunei Dollar" used in: BRUNEI DARUSSALAM.
 
enum PECUNIA_EXPORT BOB = 68
 The currency code for the "Boliviano" used in: BOLIVIA (PLURINATIONAL STATE OF).
 
enum PECUNIA_EXPORT BOV = 984
 The currency code for the "Mvdol" used in: BOLIVIA (PLURINATIONAL STATE OF).
 
enum PECUNIA_EXPORT BRL = 986
 The currency code for the "Brazilian Real" used in: BRAZIL.
 
enum PECUNIA_EXPORT BSD = 44
 The currency code for the "Bahamian Dollar" used in: BAHAMAS (THE).
 
enum PECUNIA_EXPORT BTN = 64
 The currency code for the "Ngultrum" used in: BHUTAN.
 
enum PECUNIA_EXPORT BWP = 72
 The currency code for the "Pula" used in: BOTSWANA.
 
enum PECUNIA_EXPORT BYN = 933
 The currency code for the "Belarusian Ruble" used in: BELARUS.
 
enum PECUNIA_EXPORT BZD = 84
 The currency code for the "Belize Dollar" used in: BELIZE.
 
enum PECUNIA_EXPORT CAD = 124
 The currency code for the "Canadian Dollar" used in: CANADA.
 
enum PECUNIA_EXPORT CDF = 976
 The currency code for the "Congolese Franc" used in: CONGO (THE DEMOCRATIC REPUBLIC OF THE).
 
enum PECUNIA_EXPORT CHE = 947
 The currency code for the "WIR Euro" used in: SWITZERLAND.
 
enum PECUNIA_EXPORT CHF = 756
 The currency code for the "Swiss Franc" used in: LIECHTENSTEIN; SWITZERLAND.
 
enum PECUNIA_EXPORT CHW = 948
 The currency code for the "WIR Franc" used in: SWITZERLAND.
 
enum PECUNIA_EXPORT CLF = 990
 The currency code for the "Unidad de Fomento" used in: CHILE.
 
enum PECUNIA_EXPORT CLP = 152
 The currency code for the "Chilean Peso" used in: CHILE.
 
enum PECUNIA_EXPORT CNY = 156
 The currency code for the "Yuan Renminbi" used in: CHINA.
 
enum PECUNIA_EXPORT COP = 170
 The currency code for the "Colombian Peso" used in: COLOMBIA.
 
enum PECUNIA_EXPORT COU = 970
 The currency code for the "Unidad de Valor Real" used in: COLOMBIA.
 
enum PECUNIA_EXPORT CRC = 188
 The currency code for the "Costa Rican Colon" used in: COSTA RICA.
 
enum PECUNIA_EXPORT CUP = 192
 The currency code for the "Cuban Peso" used in: CUBA.
 
enum PECUNIA_EXPORT Currency
 The unique identifier for a country's currency, monetary market, etc. using the ISO-4217 standard.
 
enum PECUNIA_EXPORT CVE = 132
 The currency code for the "Cabo Verde Escudo" used in: CABO VERDE.
 
enum PECUNIA_EXPORT CZK = 203
 The currency code for the "Czech Koruna" used in: CZECHIA.
 
enum PECUNIA_EXPORT DJF = 262
 The currency code for the "Djibouti Franc" used in: DJIBOUTI.
 
enum PECUNIA_EXPORT DKK = 208
 The currency code for the "Danish Krone" used in: DENMARK; FAROE ISLANDS (THE); GREENLAND.
 
enum PECUNIA_EXPORT DOP = 214
 The currency code for the "Dominican Peso" used in: DOMINICAN REPUBLIC (THE).
 
enum PECUNIA_EXPORT DZD = 12
 The currency code for the "Algerian Dinar" used in: ALGERIA.
 
enum PECUNIA_EXPORT EGP = 818
 The currency code for the "Egyptian Pound" used in: EGYPT.
 
enum PECUNIA_EXPORT ERN = 232
 The currency code for the "Nakfa" used in: ERITREA.
 
enum PECUNIA_EXPORT ETB = 230
 The currency code for the "Ethiopian Birr" used in: ETHIOPIA.
 
enum PECUNIA_EXPORT EUR = 978
 The currency code for the "Euro" used in: ANDORRA; AUSTRIA; BELGIUM; CROATIA; CYPRUS; ESTONIA; EUROPEAN UNION; FINLAND; FRANCE; FRENCH GUIANA; FRENCH SOUTHERN TERRITORIES (THE); GERMANY; GREECE; GUADELOUPE; HOLY SEE (THE); IRELAND; ITALY; LATVIA; LITHUANIA; LUXEMBOURG; MALTA; MARTINIQUE; MAYOTTE; MONACO; MONTENEGRO; NETHERLANDS (THE); PORTUGAL; RÉUNION; SAINT BARTHÉLEMY; SAINT MARTIN (FRENCH PART); SAINT PIERRE AND MIQUELON; SAN MARINO; SLOVAKIA; SLOVENIA; SPAIN; ÅLAND ISLANDS.
 
enum PECUNIA_EXPORT FJD = 242
 The currency code for the "Fiji Dollar" used in: FIJI.
 
enum PECUNIA_EXPORT FKP = 238
 The currency code for the "Falkland Islands Pound" used in: FALKLAND ISLANDS (THE) [MALVINAS].
 
enum PECUNIA_EXPORT GBP = 826
 The currency code for the "Pound Sterling" used in: GUERNSEY; ISLE OF MAN; JERSEY; UNITED KINGDOM OF GREAT BRITAIN AND NORTHERN IRELAND (THE).
 
enum PECUNIA_EXPORT GEL = 981
 The currency code for the "Lari" used in: GEORGIA.
 
enum PECUNIA_EXPORT GHS = 936
 The currency code for the "Ghana Cedi" used in: GHANA.
 
enum PECUNIA_EXPORT GIP = 292
 The currency code for the "Gibraltar Pound" used in: GIBRALTAR.
 
enum PECUNIA_EXPORT GMD = 270
 The currency code for the "Dalasi" used in: GAMBIA (THE).
 
enum PECUNIA_EXPORT GNF = 324
 The currency code for the "Guinean Franc" used in: GUINEA.
 
enum PECUNIA_EXPORT GTQ = 320
 The currency code for the "Quetzal" used in: GUATEMALA.
 
enum PECUNIA_EXPORT GYD = 328
 The currency code for the "Guyana Dollar" used in: GUYANA.
 
enum PECUNIA_EXPORT HKD = 344
 The currency code for the "Hong Kong Dollar" used in: HONG KONG.
 
enum PECUNIA_EXPORT HNL = 340
 The currency code for the "Lempira" used in: HONDURAS.
 
enum PECUNIA_EXPORT HTG = 332
 The currency code for the "Gourde" used in: HAITI.
 
enum PECUNIA_EXPORT HUF = 348
 The currency code for the "Forint" used in: HUNGARY.
 
enum PECUNIA_EXPORT IDR = 360
 The currency code for the "Rupiah" used in: INDONESIA.
 
enum PECUNIA_EXPORT ILS = 376
 The currency code for the "New Israeli Sheqel" used in: ISRAEL.
 
enum PECUNIA_EXPORT INR = 356
 The currency code for the "Indian Rupee" used in: BHUTAN; INDIA.
 
enum PECUNIA_EXPORT IQD = 368
 The currency code for the "Iraqi Dinar" used in: IRAQ.
 
enum PECUNIA_EXPORT IRR = 364
 The currency code for the "Iranian Rial" used in: IRAN (ISLAMIC REPUBLIC OF).
 
enum PECUNIA_EXPORT ISK = 352
 The currency code for the "Iceland Krona" used in: ICELAND.
 
constexpr auto isoCurrencySize {3}
 The number of characters in an ISO-4217 currency code string.
 
enum PECUNIA_EXPORT JMD = 388
 The currency code for the "Jamaican Dollar" used in: JAMAICA.
 
enum PECUNIA_EXPORT JOD = 400
 The currency code for the "Jordanian Dinar" used in: JORDAN.
 
enum PECUNIA_EXPORT JPY = 392
 The currency code for the "Yen" used in: JAPAN.
 
enum PECUNIA_EXPORT KES = 404
 The currency code for the "Kenyan Shilling" used in: KENYA.
 
enum PECUNIA_EXPORT KGS = 417
 The currency code for the "Som" used in: KYRGYZSTAN.
 
enum PECUNIA_EXPORT KHR = 116
 The currency code for the "Riel" used in: CAMBODIA.
 
enum PECUNIA_EXPORT KMF = 174
 The currency code for the "Comorian Franc " used in: COMOROS (THE).
 
enum PECUNIA_EXPORT KPW = 408
 The currency code for the "North Korean Won" used in: KOREA (THE DEMOCRATIC PEOPLE’S REPUBLIC OF).
 
enum PECUNIA_EXPORT KRW = 410
 The currency code for the "Won" used in: KOREA (THE REPUBLIC OF).
 
enum PECUNIA_EXPORT KWD = 414
 The currency code for the "Kuwaiti Dinar" used in: KUWAIT.
 
enum PECUNIA_EXPORT KYD = 136
 The currency code for the "Cayman Islands Dollar" used in: CAYMAN ISLANDS (THE).
 
enum PECUNIA_EXPORT KZT = 398
 The currency code for the "Tenge" used in: KAZAKHSTAN.
 
enum PECUNIA_EXPORT LAK = 418
 The currency code for the "Lao Kip" used in: LAO PEOPLE’S DEMOCRATIC REPUBLIC (THE).
 
enum PECUNIA_EXPORT LBP = 422
 The currency code for the "Lebanese Pound" used in: LEBANON.
 
enum PECUNIA_EXPORT LKR = 144
 The currency code for the "Sri Lanka Rupee" used in: SRI LANKA.
 
enum PECUNIA_EXPORT LRD = 430
 The currency code for the "Liberian Dollar" used in: LIBERIA.
 
enum PECUNIA_EXPORT LSL = 426
 The currency code for the "Loti" used in: LESOTHO.
 
enum PECUNIA_EXPORT LYD = 434
 The currency code for the "Libyan Dinar" used in: LIBYA.
 
enum PECUNIA_EXPORT MAD = 504
 The currency code for the "Moroccan Dirham" used in: MOROCCO; WESTERN SAHARA.
 
enum PECUNIA_EXPORT MDL = 498
 The currency code for the "Moldovan Leu" used in: MOLDOVA (THE REPUBLIC OF).
 
enum PECUNIA_EXPORT MGA = 969
 The currency code for the "Malagasy Ariary" used in: MADAGASCAR.
 
enum PECUNIA_EXPORT MKD = 807
 The currency code for the "Denar" used in: NORTH MACEDONIA.
 
enum PECUNIA_EXPORT MMK = 104
 The currency code for the "Kyat" used in: MYANMAR.
 
enum PECUNIA_EXPORT MNT = 496
 The currency code for the "Tugrik" used in: MONGOLIA.
 
enum PECUNIA_EXPORT MOP = 446
 The currency code for the "Pataca" used in: MACAO.
 
enum PECUNIA_EXPORT MRU = 929
 The currency code for the "Ouguiya" used in: MAURITANIA.
 
enum PECUNIA_EXPORT MUR = 480
 The currency code for the "Mauritius Rupee" used in: MAURITIUS.
 
enum PECUNIA_EXPORT MVR = 462
 The currency code for the "Rufiyaa" used in: MALDIVES.
 
enum PECUNIA_EXPORT MWK = 454
 The currency code for the "Malawi Kwacha" used in: MALAWI.
 
enum PECUNIA_EXPORT MXN = 484
 The currency code for the "Mexican Peso" used in: MEXICO.
 
enum PECUNIA_EXPORT MXV = 979
 The currency code for the "Mexican Unidad de Inversion (UDI)" used in: MEXICO.
 
enum PECUNIA_EXPORT MYR = 458
 The currency code for the "Malaysian Ringgit" used in: MALAYSIA.
 
enum PECUNIA_EXPORT MZN = 943
 The currency code for the "Mozambique Metical" used in: MOZAMBIQUE.
 
enum PECUNIA_EXPORT NAD = 516
 The currency code for the "Namibia Dollar" used in: NAMIBIA.
 
enum PECUNIA_EXPORT NGN = 566
 The currency code for the "Naira" used in: NIGERIA.
 
enum PECUNIA_EXPORT NIO = 558
 The currency code for the "Cordoba Oro" used in: NICARAGUA.
 
enum PECUNIA_EXPORT NOK = 578
 The currency code for the "Norwegian Krone" used in: BOUVET ISLAND; NORWAY; SVALBARD AND JAN MAYEN.
 
enum PECUNIA_EXPORT NPR = 524
 The currency code for the "Nepalese Rupee" used in: NEPAL.
 
enum PECUNIA_EXPORT NZD = 554
 The currency code for the "New Zealand Dollar" used in: COOK ISLANDS (THE); NEW ZEALAND; NIUE; PITCAIRN; TOKELAU.
 
enum PECUNIA_EXPORT OMR = 512
 The currency code for the "Rial Omani" used in: OMAN.
 
enum PECUNIA_EXPORT PAB = 590
 The currency code for the "Balboa" used in: PANAMA.
 
enum PECUNIA_EXPORT PEN = 604
 The currency code for the "Sol" used in: PERU.
 
enum PECUNIA_EXPORT PGK = 598
 The currency code for the "Kina" used in: PAPUA NEW GUINEA.
 
enum PECUNIA_EXPORT PHP = 608
 The currency code for the "Philippine Peso" used in: PHILIPPINES (THE).
 
enum PECUNIA_EXPORT PKR = 586
 The currency code for the "Pakistan Rupee" used in: PAKISTAN.
 
enum PECUNIA_EXPORT PLN = 985
 The currency code for the "Zloty" used in: POLAND.
 
enum PECUNIA_EXPORT PYG = 600
 The currency code for the "Guarani" used in: PARAGUAY.
 
enum PECUNIA_EXPORT QAR = 634
 The currency code for the "Qatari Rial" used in: QATAR.
 
enum PECUNIA_EXPORT RON = 946
 The currency code for the "Romanian Leu" used in: ROMANIA.
 
enum PECUNIA_EXPORT RSD = 941
 The currency code for the "Serbian Dinar" used in: SERBIA.
 
enum PECUNIA_EXPORT RUB = 643
 The currency code for the "Russian Ruble" used in: RUSSIAN FEDERATION (THE).
 
enum PECUNIA_EXPORT RWF = 646
 The currency code for the "Rwanda Franc" used in: RWANDA.
 
enum PECUNIA_EXPORT SAR = 682
 The currency code for the "Saudi Riyal" used in: SAUDI ARABIA.
 
enum PECUNIA_EXPORT SBD = 90
 The currency code for the "Solomon Islands Dollar" used in: SOLOMON ISLANDS.
 
enum PECUNIA_EXPORT SCR = 690
 The currency code for the "Seychelles Rupee" used in: SEYCHELLES.
 
enum PECUNIA_EXPORT SDG = 938
 The currency code for the "Sudanese Pound" used in: SUDAN (THE).
 
enum PECUNIA_EXPORT SEK = 752
 The currency code for the "Swedish Krona" used in: SWEDEN.
 
enum PECUNIA_EXPORT SGD = 702
 The currency code for the "Singapore Dollar" used in: SINGAPORE.
 
enum PECUNIA_EXPORT SHP = 654
 The currency code for the "Saint Helena Pound" used in: SAINT HELENA, ASCENSION AND TRISTAN DA CUNHA.
 
enum PECUNIA_EXPORT SLE = 925
 The currency code for the "Leone" used in: SIERRA LEONE.
 
enum PECUNIA_EXPORT SOS = 706
 The currency code for the "Somali Shilling" used in: SOMALIA.
 
enum PECUNIA_EXPORT SRD = 968
 The currency code for the "Surinam Dollar" used in: SURINAME.
 
enum PECUNIA_EXPORT SSP = 728
 The currency code for the "South Sudanese Pound" used in: SOUTH SUDAN.
 
enum PECUNIA_EXPORT STN = 930
 The currency code for the "Dobra" used in: SAO TOME AND PRINCIPE.
 
enum PECUNIA_EXPORT SVC = 222
 The currency code for the "El Salvador Colon" used in: EL SALVADOR.
 
enum PECUNIA_EXPORT SYP = 760
 The currency code for the "Syrian Pound" used in: SYRIAN ARAB REPUBLIC.
 
enum PECUNIA_EXPORT SZL = 748
 The currency code for the "Lilangeni" used in: ESWATINI.
 
enum PECUNIA_EXPORT THB = 764
 The currency code for the "Baht" used in: THAILAND.
 
enum PECUNIA_EXPORT TJS = 972
 The currency code for the "Somoni" used in: TAJIKISTAN.
 
enum PECUNIA_EXPORT TMT = 934
 The currency code for the "Turkmenistan New Manat" used in: TURKMENISTAN.
 
enum PECUNIA_EXPORT TND = 788
 The currency code for the "Tunisian Dinar" used in: TUNISIA.
 
enum PECUNIA_EXPORT TOP = 776
 The currency code for the "Pa’anga" used in: TONGA.
 
enum PECUNIA_EXPORT TRY = 949
 The currency code for the "Turkish Lira" used in: TÜRKİYE.
 
enum PECUNIA_EXPORT TTD = 780
 The currency code for the "Trinidad and Tobago Dollar" used in: TRINIDAD AND TOBAGO.
 
enum PECUNIA_EXPORT TWD = 901
 The currency code for the "New Taiwan Dollar" used in: TAIWAN (PROVINCE OF CHINA).
 
enum PECUNIA_EXPORT TZS = 834
 The currency code for the "Tanzanian Shilling" used in: TANZANIA, UNITED REPUBLIC OF.
 
enum PECUNIA_EXPORT UAH = 980
 The currency code for the "Hryvnia" used in: UKRAINE.
 
enum PECUNIA_EXPORT UGX = 800
 The currency code for the "Uganda Shilling" used in: UGANDA.
 
static struct pecunia::PECUNIA_EXPORT unexpectedErr
 
enum PECUNIA_EXPORT USD = 840
 The currency code for the "US Dollar" used in: AMERICAN SAMOA; BONAIRE, SINT EUSTATIUS AND SABA; BRITISH INDIAN OCEAN TERRITORY (THE); ECUADOR; EL SALVADOR; GUAM; HAITI; MARSHALL ISLANDS (THE); MICRONESIA (FEDERATED STATES OF); NORTHERN MARIANA ISLANDS (THE); PALAU; PANAMA; PUERTO RICO; TIMOR-LESTE; TURKS AND CAICOS ISLANDS (THE); UNITED STATES MINOR OUTLYING ISLANDS (THE); UNITED STATES OF AMERICA (THE); VIRGIN ISLANDS (BRITISH); VIRGIN ISLANDS (U.S.).
 
enum PECUNIA_EXPORT USN = 997
 The currency code for the "US Dollar (Next day)" used in: UNITED STATES OF AMERICA (THE).
 
enum PECUNIA_EXPORT UYI = 940
 The currency code for the "Uruguay Peso en Unidades Indexadas (UI)" used in: URUGUAY.
 
enum PECUNIA_EXPORT UYU = 858
 The currency code for the "Peso Uruguayo" used in: URUGUAY.
 
enum PECUNIA_EXPORT UYW = 927
 The currency code for the "Unidad Previsional" used in: URUGUAY.
 
enum PECUNIA_EXPORT UZS = 860
 The currency code for the "Uzbekistan Sum" used in: UZBEKISTAN.
 
enum PECUNIA_EXPORT VED = 926
 The currency code for the "Bolívar Soberano" used in: VENEZUELA (BOLIVARIAN REPUBLIC OF).
 
enum PECUNIA_EXPORT VES = 928
 The currency code for the "Bolívar Soberano" used in: VENEZUELA (BOLIVARIAN REPUBLIC OF).
 
enum PECUNIA_EXPORT VND = 704
 The currency code for the "Dong" used in: VIET NAM.
 
enum PECUNIA_EXPORT VUV = 548
 The currency code for the "Vatu" used in: VANUATU.
 
enum PECUNIA_EXPORT WST = 882
 The currency code for the "Tala" used in: SAMOA.
 
enum PECUNIA_EXPORT XAD = 396
 The currency code for the "Arab Accounting Dinar" used in: ARAB MONETARY FUND.
 
enum PECUNIA_EXPORT XAF = 950
 The currency code for the "CFA Franc BEAC" used in: CAMEROON; CENTRAL AFRICAN REPUBLIC (THE); CHAD; CONGO (THE); EQUATORIAL GUINEA; GABON.
 
enum PECUNIA_EXPORT XAG = 961
 The currency code for the "Silver" used in: ZZ11_Silver.
 
enum PECUNIA_EXPORT XAU = 959
 The currency code for the "Gold" used in: ZZ08_Gold.
 
enum PECUNIA_EXPORT XBA = 955
 The currency code for the "Bond Markets Unit European Composite Unit (EURCO)" used in: ZZ01_Bond Markets Unit European_EURCO.
 
enum PECUNIA_EXPORT XBB = 956
 The currency code for the "Bond Markets Unit European Monetary Unit (E.M.U.-6)" used in: ZZ02_Bond Markets Unit European_EMU-6.
 
enum PECUNIA_EXPORT XBC = 957
 The currency code for the "Bond Markets Unit European Unit of Account 9 (E.U.A.-9)" used in: ZZ03_Bond Markets Unit European_EUA-9.
 
enum PECUNIA_EXPORT XBD = 958
 The currency code for the "Bond Markets Unit European Unit of Account 17 (E.U.A.-17)" used in: ZZ04_Bond Markets Unit European_EUA-17.
 
enum PECUNIA_EXPORT XCD = 951
 The currency code for the "East Caribbean Dollar" used in: ANGUILLA; ANTIGUA AND BARBUDA; DOMINICA; GRENADA; MONTSERRAT; SAINT KITTS AND NEVIS; SAINT LUCIA; SAINT VINCENT AND THE GRENADINES.
 
enum PECUNIA_EXPORT XCG = 532
 The currency code for the "Caribbean Guilder" used in: CURAÇAO; SINT MAARTEN (DUTCH PART).
 
enum PECUNIA_EXPORT XDR = 960
 The currency code for the "SDR (Special Drawing Right)" used in: INTERNATIONAL MONETARY FUND (IMF) .
 
enum PECUNIA_EXPORT XOF = 952
 The currency code for the "CFA Franc BCEAO" used in: BENIN; BURKINA FASO; CÔTE D'IVOIRE; GUINEA-BISSAU; MALI; NIGER (THE); SENEGAL; TOGO.
 
enum PECUNIA_EXPORT XPD = 964
 The currency code for the "Palladium" used in: ZZ09_Palladium.
 
enum PECUNIA_EXPORT XPF = 953
 The currency code for the "CFP Franc" used in: FRENCH POLYNESIA; NEW CALEDONIA; WALLIS AND FUTUNA.
 
enum PECUNIA_EXPORT XPT = 962
 The currency code for the "Platinum" used in: ZZ10_Platinum.
 
enum PECUNIA_EXPORT XSU = 994
 The currency code for the "Sucre" used in: SISTEMA UNITARIO DE COMPENSACION REGIONAL DE PAGOS "SUCRE".
 
enum PECUNIA_EXPORT XTS = 963
 The currency code for the "Codes specifically reserved for testing purposes" used in: ZZ06_Testing_Code.
 
enum PECUNIA_EXPORT XUA = 965
 The currency code for the "ADB Unit of Account" used in: MEMBER COUNTRIES OF THE AFRICAN DEVELOPMENT BANK GROUP.
 
enum PECUNIA_EXPORT XXX = 999
 The currency code for the "The codes assigned for transactions where no currency is involved" used in: ZZ07_No_Currency.
 
enum PECUNIA_EXPORT YER = 886
 The currency code for the "Yemeni Rial" used in: YEMEN.
 
enum PECUNIA_EXPORT ZAR = 710
 The currency code for the "Rand" used in: LESOTHO; NAMIBIA; SOUTH AFRICA.
 
enum PECUNIA_EXPORT ZMW = 967
 The currency code for the "Zambian Kwacha" used in: ZAMBIA.
 
enum PECUNIA_EXPORT ZWG = 924
 The currency code for the "Zimbabwe Gold" used in: ZIMBABWE.
 

Typedef Documentation

◆ ConversionFunction

Initial value:
std::function<FloatingPoint(const Currency&, const Currency&)>

A conversion function between two currencies where the first argument is the currency to convert from, the second argument is the currency to convert to, and giving back the conversion factor to get from the first currency to the second currency.

Exceptions
pecunia::RuntimeErrorWhen either the conversion from or to a currency is not supported.

◆ FloatingPointRounderFunction

Initial value:
std::function<FloatingPoint(const FloatingPoint&, const std::uint8_t&)>

A representation of a function that performs a rounding operation upon a real number. This function must take a number, the number of digits after the whole number to round, and giving back the rounded number.

Exceptions
pecunia::RuntimeErrorWhen the rounding is not possible.

◆ RounderFunction

Initial value:
std::function<MajorUnit(const MajorUnit&, const std::uint8_t&, const std::uint8_t)>

A representation of a function that performs a rounding operation upon a money storage type. This function must take first the major and minor amount value stored together, then the number of digits in the minor unit, finally the number of digits after the whole number to round, and giving back the rounded number with the major and minor amount stored together.

Exceptions
pecunia::RuntimeErrorWhen the rounding is not possible.

Function Documentation

◆ apply() [1/2]

template<typename ValueType , typename ErrorType >
const Expected< ValueType, ErrorType > & pecunia::apply ( const Expected< ValueType, ErrorType > & expected,
const std::function< void(const ValueType &)> & matchesValueType,
const std::function< void(const ErrorType &)> & matchesErrorType )

Applies a specified operation based on the state of the provided object.

This method invokes the appropriate function depending on whether the object contains a value or an error. It is useful for handling objects in a structured and functional way, ensuring the appropriate operation is applied based on the internal state of the object.

Precondition
The provided functions must be callable with their respective types.
Template Parameters
ValueTypeThe type wrapped as the success value inside the object.
ErrorTypeThe type wrapped as the error inside the object.
Parameters
expectedThe object to process. It contains either ValueType or ErrorType.
matchesValueTypeThe function to be applied if the object contains a success value.
matchesErrorTypeThe function to be applied if the object contains an error.
Returns
The unmodified object.

◆ apply() [2/2]

template<typename ValueType , typename ErrorType >
Expected< ValueType, ErrorType > & pecunia::apply ( Expected< ValueType, ErrorType > & expected,
const std::function< void(ValueType &)> & matchesValueType,
const std::function< void(ErrorType &)> & matchesErrorType )

Applies a specified operation based on the state of the provided object.

This method invokes the appropriate function depending on whether the object contains a value or an error. It is useful for handling objects in a structured and functional way, ensuring the appropriate operation is applied based on the internal state of the object.

Precondition
The provided functions must be callable with their respective types.
Template Parameters
ValueTypeThe type wrapped as the success value inside the object.
ErrorTypeThe type wrapped as the error inside the object.
Parameters
expectedThe object to process. It contains either ValueType or ErrorType.
matchesValueTypeThe function to be applied if the object contains a success value.
matchesErrorTypeThe function to be applied if the object contains an error.
Postcondition
The selected function is applied to the expected’s internal success value or internal error respectively.
Returns
The modified object after applying the appropriate function.

◆ copyright()

PECUNIA_EXPORT std::string pecunia::copyright ( )
nodiscardnoexcept

Provides the copyright of the library.

◆ countriesUsing()

PECUNIA_EXPORT std::vector< std::string > pecunia::countriesUsing ( const Currency & code)
nodiscardnoexcept

Looks-up the countries which are using a given currency.

Parameters
codeThe code of the currency to look-up for all the countries.
Returns
All the countries found.

◆ currencyName()

PECUNIA_EXPORT std::string pecunia::currencyName ( const Currency & code)
nodiscardnoexcept

Looks-up the name of a currency using a given currency code.

Parameters
codeThe code of the currency to look-up for its name.
Returns
The name of the currency in English.

◆ currencySymbol()

PECUNIA_EXPORT std::optional< std::string > pecunia::currencySymbol ( const Currency & code)
nodiscardnoexcept

Provides the native currency symbol used by a currency code. N.B. currency symbols are shared by others and are therefore cannot be unique.

Note
Currently not all codes are supported.
Parameters
codeThe country's monetary unit whose currency symbol is desired.
Returns
The string representation of the currency symbol if found, else null optional.

◆ description()

PECUNIA_EXPORT std::string pecunia::description ( )
nodiscardnoexcept

Provides the description of the library.

◆ exchangeRate()

PECUNIA_EXPORT std::optional< FloatingPoint > pecunia::exchangeRate ( const Currency & from,
const Currency & to )
nodiscardnoexcept

Retrieves the exchange rate for currency conversion.

Parameters
fromThe source currency for the conversion.
toThe target currency for the conversion.
Returns
The exchange rate between the specified currencies if known, or null if the look-up fails, or any other error occurs.

◆ isocode()

PECUNIA_EXPORT std::ios_base & pecunia::isocode ( std::ios_base & stream)
nodiscard

A stream manipulator that configures the currency representation in formatted output to use the ISO-4217 code instead of the currency symbol.

Parameters
streamThe stream to apply the manipulator to.
Postcondition
The stream’s internal state is updated to reflect the use of the ISO-4217 code for currency representation in place of the symbol.
Returns
The manipulated stream.

◆ leading()

PECUNIA_EXPORT std::ios_base & pecunia::leading ( std::ios_base & stream)
nodiscard

A stream manipulator that ensures the currency indicator is displayed before the value in formatted output.

Parameters
streamThe stream to apply the manipulator to.
Postcondition
The stream’s internal state is updated to position the currency indicator before the value.
Returns
The manipulated stream.

◆ licence()

PECUNIA_EXPORT std::string pecunia::licence ( )
nodiscardnoexcept

Provides the licence of the library.

◆ metadataVersion()

PECUNIA_EXPORT std::string pecunia::metadataVersion ( )
nodiscardnoexcept

Provides the semantic version with the metadata of the library.

◆ minorUnitDigits()

PECUNIA_EXPORT std::uint8_t pecunia::minorUnitDigits ( const Currency & code)
nodiscardnoexcept

Provides the number of digits used by the minor currency unit using the currency's ISO exponent.

Parameters
codeThe country's monetary unit whose number of digits is desired.
Returns
The number of digits used by the minor currency unit.

◆ nonspaced()

PECUNIA_EXPORT std::ios_base & pecunia::nonspaced ( std::ios_base & stream)
nodiscard

A stream manipulator that disables spacing between the currency symbol, and the numeric value in formatted output.

Parameters
streamThe stream to apply the manipulator to.
Postcondition
The stream’s internal state is updated to enforce no spaces between the currency symbol and the numeric value.
Returns
The manipulated stream.

◆ operator!=()

PECUNIA_EXPORT bool pecunia::operator!= ( const MoneyParts & lhs,
const MoneyParts & rhs )
nodiscard

General inequality operator.

Parameters
lhsThe object that is expected to be compared.
rhsThe object that is to compare for inequality.
Returns
False when the currency and monetary value are the same, true otherwise.

◆ operator*() [1/6]

PECUNIA_EXPORT Money pecunia::operator* ( const FloatingPointBase & lhs,
const Money & rhs )
nodiscard

The multiplicative operator without any loss of precision. This only supports as many digits as minor digits.

Exceptions
OverflowErrorWhen the result of the operation would be too large to store.
UnderflowErrorWhen the result of the operation would be too small to store.
Parameters
lhsThe amount by which to multiply the supplied object’s value.
rhsThe object that is to be multiplied.
Returns
A new object containing the product of the two values.

◆ operator*() [2/6]

PECUNIA_EXPORT FloatingPoint pecunia::operator* ( const FloatingPointBase multiplicand,
const FloatingPoint & multiplier )
nodiscard

Calculates the multiplication operation.

Exceptions
OverflowErrorWhen the result of the operation would result in an overflow.
UnderflowErrorWhen the result of the operation would result in an underflow.
Parameters
multiplicandThe value that is to be multiplied.
multiplierThe amount to multiply by.
Returns
The result of the operation, the product.

◆ operator*() [3/6]

PECUNIA_EXPORT Money pecunia::operator* ( const std::int16_t & lhs,
const Money & rhs )
nodiscard

The multiplicative operator without any loss of precision.

Exceptions
OverflowErrorWhen the result of the operation would be too large to store.
UnderflowErrorWhen the result of the operation would be too small to store.
Parameters
lhsThe signed 16-bit integer amount by which to multiply the supplied object’s value.
rhsThe object that is to be multiplied.
Returns
A new object containing the product of the two values.

◆ operator*() [4/6]

PECUNIA_EXPORT Money pecunia::operator* ( const std::int32_t & lhs,
const Money & rhs )
nodiscard

The multiplicative operator without any loss of precision.

Exceptions
OverflowErrorWhen the result of the operation would be too large to store.
UnderflowErrorWhen the result of the operation would be too small to store.
Parameters
lhsThe signed 32-bit integer amount by which to multiply the supplied object’s value.
rhsThe object that is to be multiplied.
Returns
A new object containing the product of the two values.

◆ operator*() [5/6]

PECUNIA_EXPORT Money pecunia::operator* ( const std::int64_t & lhs,
const Money & rhs )
nodiscard

The multiplicative operator without any loss of precision.

Exceptions
OverflowErrorWhen the result of the operation would be too large to store.
UnderflowErrorWhen the result of the operation would be too small to store.
Parameters
lhsThe signed 64-bit integer amount by which to multiply the supplied object’s value.
rhsThe object that is to be multiplied.
Returns
A new object containing the product of the two values.

◆ operator*() [6/6]

PECUNIA_EXPORT Money pecunia::operator* ( const std::int8_t & lhs,
const Money & rhs )
nodiscard

The multiplicative operator without any loss of precision.

Exceptions
OverflowErrorWhen the result of the operation would be too large to store.
UnderflowErrorWhen the result of the operation would be too small to store.
Parameters
lhsThe signed 8-bit integer amount by which to multiply the supplied object’s value.
rhsThe object that is to be multiplied.
Returns
A new object containing the product of the two values.

◆ operator/()

PECUNIA_EXPORT FloatingPoint pecunia::operator/ ( const FloatingPointBase dividend,
const FloatingPoint & divisor )
nodiscard

Calculates the division operation.

Exceptions
OverflowErrorWhen the result of the operation would result in an overflow.
UnderflowErrorWhen the result of the operation would result in an underflow.
DomainErrorWhen the result of the operation would result in a division by zero.
Parameters
dividendThe value that is to be divided, sometimes called the numerator.
divisorThe value to divide with, sometimes called the denominator.
Returns
The result of the operation, the quotient.

◆ operator<() [1/2]

PECUNIA_EXPORT bool pecunia::operator< ( const FloatingPointBase lhs,
const FloatingPoint & rhs )
nodiscard

Relationship operator checking the less-than status.

Parameters
lhsThe value to check is less-than the supplied right-hand-side value.
rhsThe value to compare against.
Returns
Gives true when the left-hand-side value is less-than the supplied right-hand-side value.

◆ operator<() [2/2]

PECUNIA_EXPORT bool pecunia::operator< ( const MoneyParts & lhs,
const MoneyParts & rhs )
nodiscard

Compares two objects to determine if the first is less than the second, considering both their currency codes and monetary values.

This function is used to perform comparisons between monetary values, ensuring accurate results by factoring in both the currency codes, and the actual monetary amounts. It is useful in sorting or scenarios requiring strict order of monetary parts.

Parameters
lhsThe first object to compare.
rhsThe second object to compare.
Returns
True if the lhs object is considered less than the rhs object; otherwise, false. Consideration is in the order currency then monetary value.

◆ operator<<() [1/2]

PECUNIA_EXPORT std::ostream & pecunia::operator<< ( std::ostream & stream,
const Currency & code )
noexcept

Performs the stream insertion for displaying the currency code in the ISO-4217 form.

Parameters
streamThe stream into which the code should be inserted.
codeThe code that will be inserted.
Returns
The same stream that was supplied, but now containing the code.

◆ operator<<() [2/2]

PECUNIA_EXPORT std::ostream & pecunia::operator<< ( std::ostream & stream,
const Money & m )

Stream Insertion Operator. By default, the form will be in the locale’s monetary format with no spaces, the ISO code, and trailing the value, e.g. a U.S.A. locale with value of one dollar and twenty-three cents would appear as 1.23USD.

Exceptions
RuntimeErrorWhen the stream fails to be written.
Parameters
streamThe destination source for the contents of the supplied money object.
mThe object whose values are placed into the destination source.
Returns
The modified source stream object filled with the contents of the money object.

◆ operator==()

PECUNIA_EXPORT bool pecunia::operator== ( const MoneyParts & lhs,
const MoneyParts & rhs )
nodiscard

General equality operator.

Parameters
lhsThe object that is expected to be compared.
rhsThe object that is to compare for equality.
Returns
True when the currency and monetary value are the same, false otherwise.

◆ operator>()

PECUNIA_EXPORT bool pecunia::operator> ( const FloatingPointBase lhs,
const FloatingPoint & rhs )
nodiscard

Relationship operator checking the greater-than status.

Parameters
lhsThe value to check is greater-than the supplied right-hand-side value.
rhsThe value to compare against.
Returns
Gives true when the left-hand-side value is greater-than the supplied right-hand-side value.

◆ operator>>()

PECUNIA_EXPORT std::istream & pecunia::operator>> ( std::istream & stream,
Money & m )

Stream Extraction Operator. The monetary amount will be read in using the locale’s setting for reading in money. The currency code is required and must be in all upper-case letters.

Precondition
The locale of the supplied stream must be set.
Exceptions
RuntimeErrorWhen the stream fails to be read.
InvalidArgumentWhen the currency is incorrectly formatted.
Parameters
streamThe extraction source for the contents of the supplied money object.
mThe object whose values are to be filled by the contents of the stream.
Returns
The modified source stream object emptied of a money entry.

◆ publishedOn()

PECUNIA_EXPORT const std::string & pecunia::publishedOn ( )
nodiscardnoexcept

The date the codes were published by the ISO.

See also
ISO-8601 https://en.wikipedia.org/wiki/ISO_8601
Returns
The date published in ISO-8601 format.

◆ setUpLibrary() [1/4]

PECUNIA_EXPORT void pecunia::setUpLibrary ( )

Sets up the behaviour for the library, ensuring a suitable default environment is established for monetary computations.

Exceptions
RuntimeErrorThrown if floating-point exception flags cannot be cleared.
Postcondition
The currency conversion function only works when the currencies are the same.
The locale is set to the default configured value.
All floating-point exception flags are cleared.

◆ setUpLibrary() [2/4]

PECUNIA_EXPORT void pecunia::setUpLibrary ( const ConversionFunction & converterFunctor)

Sets up currency-related behaviours for the library. This ensures the proper environment is established for currency operations.

Precondition
The converterFunctor must point to a valid function and must not be null.
Exceptions
RuntimeErrorThrown if floating-point exception flags cannot be cleared.
Parameters
converterFunctorThe function used for currency conversion.
Postcondition
The currency conversion function is successfully established.
All floating-point exception flags are cleared.

◆ setUpLibrary() [3/4]

PECUNIA_EXPORT void pecunia::setUpLibrary ( const ConversionFunction & converterFunctor,
const std::string & localeName )

Sets up currency-related behaviours for the library. This ensures the proper environment is established for currency operations.

Precondition
The converterFunctor must point to a valid function and must not be null.
The locale should represent a valid locale format supported by the system.
Exceptions
RuntimeErrorThrown if the locale cannot be set to the given input.
RuntimeErrorThrown if floating-point exception flags cannot be cleared.
Parameters
converterFunctorThe function used for currency conversion.
localeNameThe locale to set for currency localisation.
Postcondition
The currency conversion function is successfully established.
The locale is set to the specified value.
All floating-point exception flags are cleared.

◆ setUpLibrary() [4/4]

PECUNIA_EXPORT void pecunia::setUpLibrary ( const std::string & localeName)

Sets up currency-related behaviours for the library. This ensures the proper environment is established for currency operations.

Precondition
The locale should represent a valid locale format supported by the system.
Exceptions
RuntimeErrorThrown if the locale cannot be set to the given input.
RuntimeErrorThrown if floating-point exception flags cannot be cleared.
Parameters
localeNameThe locale to set for currency localisation.
Postcondition
The currency conversion function only works when the currencies are the same.
The locale is set to the specified value.
All floating-point exception flags are cleared.

◆ sort()

template<typename ContainerType >
void pecunia::sort ( ContainerType & container,
const std::function< void(typename ContainerType::value_type &, typename ContainerType::value_type &) > & swaperator = pecunia::swap )

Sorts the container using a less-than comparison operator. The sort is not stable.

Template Parameters
ContainerTypeThe type of container holding the monetary values to sort. The container must have random access iterator support. The contained type must support the operators less-than, greater-than, and have a swap function.
Parameters
containerThe container holding the monetary values to sort.
swaperatorA function that will swap the contained values using no monetary conversion in the process.

◆ spaced()

PECUNIA_EXPORT std::ios_base & pecunia::spaced ( std::ios_base & stream)
nodiscard

A stream manipulator that ensures a space is inserted appropriately between components in formatted monetary output.

Parameters
streamThe stream to apply the manipulator to.
Postcondition
The stream’s internal state is updated to indicate that spacing should be applied between monetary components.
Returns
The manipulated stream.

◆ split() [1/2]

PECUNIA_EXPORT MoneyParts pecunia::split ( const std::string & amount)
nodiscard

Splits a string into the various parts of a monetary value. Performance wise it will favour strings with a trailing currency. Uses the systems locale to determine the major and minor separator. Valid forms are:

  • CurrencyMajorSeparatorMinorSub-minor
    • CurrencyMajorSeparatorMinor
    • CurrencyMajorSeparator
    • CurrencyMajor
  • MajorSeparatorMinorSub-minorCurrency
    • MajorSeparatorMinorCurrency
    • MajorSeparatorCurrency
    • MajorCurrency
Exceptions
InvalidArgumentWhen the string does not contain a valid currency.
InvalidArgumentWhen the string contains an invalid major/minor separator.
OverflowErrorWhen the string contains a major value too large to store.
OutOfRangeWhen the string contains a major value too large to store temporally.
InvalidArgumentWhen the string contains an invalid major value.
InvalidArgumentWhen the string contains an invalid minor value.
InvalidArgumentWhen the string does not contain a minor value and should.
OverflowErrorWhen the string contains a minor value too large to store.
OutOfRangeWhen the string contains a minor value too large to store temporally.
InvalidArgumentWhen the string contains an invalid minor value.
InvalidArgumentWhen the string does not contain a valid sub-minor value.
OverflowErrorWhen the string contains a sub-minor value too large to store.
Parameters
amountThe sequence of characters to split as a monetary value.
Returns
Every part of the monetary value split apart.

◆ split() [2/2]

PECUNIA_EXPORT MoneyParts pecunia::split ( const std::string & amount,
const char majorMinorSeparator )
nodiscard

Splits a string into the various parts of a monetary value. Performance wise it will favour strings with a trailing currency. Valid forms are:

  • CurrencyMajorSeparatorMinorSub-minor
    • CurrencyMajorSeparatorMinor
    • CurrencyMajorSeparator
    • CurrencyMajor
  • MajorSeparatorMinorSub-minorCurrency
    • MajorSeparatorMinorCurrency
    • MajorSeparatorCurrency
    • MajorCurrency
Exceptions
InvalidArgumentWhen the string does not contain a valid currency.
InvalidArgumentWhen the string contains an invalid major/minor separator.
OverflowErrorWhen the string contains a major value too large to store.
OutOfRangeWhen the string contains a major value too large to store temporally.
InvalidArgumentWhen the string contains an invalid major value.
InvalidArgumentWhen the string contains an invalid minor value.
InvalidArgumentWhen the string does not contain a minor value and should.
OverflowErrorWhen the string contains a minor value too large to store.
OutOfRangeWhen the string contains a minor value too large to store temporally.
InvalidArgumentWhen the string contains an invalid minor value.
InvalidArgumentWhen the string does not contain a valid sub-minor value.
OverflowErrorWhen the string contains a sub-minor value too large to store.
Parameters
amountThe sequence of characters to split as a monetary value.
majorMinorSeparatorThe character expected as the separator between a major and minor values.
Returns
Every part of the monetary value split apart.

◆ swap()

PECUNIA_EXPORT void pecunia::swap ( Money & lhs,
Money & rhs )
noexcept

Exchanges two monetary objects without any conversion operation performed.

Parameters
lhsThe object to swap to the right.
rhsThe object to swap to the left.

◆ symbol()

PECUNIA_EXPORT std::ios_base & pecunia::symbol ( std::ios_base & stream)
nodiscard

Sets the stream to apply a currency symbol formatting behaviour during output operations.

Parameters
streamThe stream on which to set the currency symbol formatting behaviour.
Postcondition
The stream’s internal state is updated to enable the display of the currency symbol.
Returns
The modified stream with the currency symbol formatting behaviour enabled.

◆ toCurrency()

PECUNIA_EXPORT Currency pecunia::toCurrency ( const std::string & code)
nodiscard

Converts a given string representation of a currency code to its corresponding strong object form.

Exceptions
InvalidArgumentThrown if the provided currency code is invalid or not found.
Parameters
codeThe string representation of the ISO-4217 currency code to convert. The text must be all upper-cased.
Returns
The object corresponding to the provided currency code.

◆ toMinorUnit()

PECUNIA_EXPORT MinorUnit pecunia::toMinorUnit ( const MinorUnit & minor,
const Currency & code )
nodiscard

Converts a truncated minor value into a minor and sub-minor value, i.e. given a value of USD 25 cents it'll convert it into "2500".

Exceptions
pecunia::OverflowErrorWhen the supplied minor value is greater than possibly can be stored in a currency's minor value.
Parameters
minorThe minor value without the extra sub-minor amount.
codeThe currency the minor unit is in.
Returns
The minor amount adjusted for the number of sub-minor digits and minor digits found in the currency where all the sub-minor digits are padded with zeros.

◆ toStdString() [1/2]

enum PECUNIA_EXPORT PECUNIA_EXPORT std::string pecunia::toStdString ( const Currency & code)
nodiscardnoexcept

Converts from a strongly-typed ISO code to a weak string form.

Parameters
codeThe country's monetary unit whose ISO code is to be converted.
Returns
The weak type form of the ISO code.

◆ toStdString() [2/2]

PECUNIA_EXPORT std::string pecunia::toStdString ( const Money & m)
nodiscard

Converts the monetary representation into a string from. The format of the string representation is the amount followed by a space, and the currency code.

Parameters
mThe object whose values are to be converted into a string form.
Returns
The string representation of the monetary amount.

◆ trailing()

PECUNIA_EXPORT std::ios_base & pecunia::trailing ( std::ios_base & stream)
nodiscard

A stream manipulator that positions the currency indicator after the monetary value in formatted output.

Parameters
streamThe stream to apply the manipulator to.
Postcondition
The stream’s internal state is updated to position the currency indicator after the value.
Returns
The manipulated stream.

◆ url()

PECUNIA_EXPORT std::string pecunia::url ( )
nodiscardnoexcept

Provides the URL of the library.

◆ version()

PECUNIA_EXPORT std::string pecunia::version ( )
nodiscardnoexcept

Provides the semantic version without the metadata of the library.

Variable Documentation

◆ AFN

enum PECUNIA_EXPORT pecunia::AFN = 971

The currency code for the "Afghani" used in: AFGHANISTAN.

◆ ALL

enum PECUNIA_EXPORT pecunia::ALL = 8

The currency code for the "Lek" used in: ALBANIA.

◆ allCurrencies

PECUNIA_EXPORT const std::array<Currency, 179> pecunia::allCurrencies
extern

A container of every currency code known. The codes are sorted in alphabetical order.

◆ AMD

enum PECUNIA_EXPORT pecunia::AMD = 51

The currency code for the "Armenian Dram" used in: ARMENIA.

◆ AOA

enum PECUNIA_EXPORT pecunia::AOA = 973

The currency code for the "Kwanza" used in: ANGOLA.

◆ ARS

enum PECUNIA_EXPORT pecunia::ARS = 32

The currency code for the "Argentine Peso" used in: ARGENTINA.

◆ AUD

enum PECUNIA_EXPORT pecunia::AUD = 36

The currency code for the "Australian Dollar" used in: AUSTRALIA; CHRISTMAS ISLAND; COCOS (KEELING) ISLANDS (THE); HEARD ISLAND AND McDONALD ISLANDS; KIRIBATI; NAURU; NORFOLK ISLAND; TUVALU.

◆ AWG

enum PECUNIA_EXPORT pecunia::AWG = 533

The currency code for the "Aruban Florin" used in: ARUBA.

◆ AZN

enum PECUNIA_EXPORT pecunia::AZN = 944

The currency code for the "Azerbaijan Manat" used in: AZERBAIJAN.

◆ BAM

enum PECUNIA_EXPORT pecunia::BAM = 977

The currency code for the "Convertible Mark" used in: BOSNIA AND HERZEGOVINA.

◆ BBD

enum PECUNIA_EXPORT pecunia::BBD = 52

The currency code for the "Barbados Dollar" used in: BARBADOS.

◆ BDT

enum PECUNIA_EXPORT pecunia::BDT = 50

The currency code for the "Taka" used in: BANGLADESH.

◆ BGN

enum PECUNIA_EXPORT pecunia::BGN = 975

The currency code for the "Bulgarian Lev" used in: BULGARIA.

◆ BHD

enum PECUNIA_EXPORT pecunia::BHD = 48

The currency code for the "Bahraini Dinar" used in: BAHRAIN.

◆ BIF

enum PECUNIA_EXPORT pecunia::BIF = 108

The currency code for the "Burundi Franc" used in: BURUNDI.

◆ BMD

enum PECUNIA_EXPORT pecunia::BMD = 60

The currency code for the "Bermudian Dollar" used in: BERMUDA.

◆ BND

enum PECUNIA_EXPORT pecunia::BND = 96

The currency code for the "Brunei Dollar" used in: BRUNEI DARUSSALAM.

◆ BOB

enum PECUNIA_EXPORT pecunia::BOB = 68

The currency code for the "Boliviano" used in: BOLIVIA (PLURINATIONAL STATE OF).

◆ BOV

enum PECUNIA_EXPORT pecunia::BOV = 984

The currency code for the "Mvdol" used in: BOLIVIA (PLURINATIONAL STATE OF).

◆ BRL

enum PECUNIA_EXPORT pecunia::BRL = 986

The currency code for the "Brazilian Real" used in: BRAZIL.

◆ BSD

enum PECUNIA_EXPORT pecunia::BSD = 44

The currency code for the "Bahamian Dollar" used in: BAHAMAS (THE).

◆ BTN

enum PECUNIA_EXPORT pecunia::BTN = 64

The currency code for the "Ngultrum" used in: BHUTAN.

◆ BWP

enum PECUNIA_EXPORT pecunia::BWP = 72

The currency code for the "Pula" used in: BOTSWANA.

◆ BYN

enum PECUNIA_EXPORT pecunia::BYN = 933

The currency code for the "Belarusian Ruble" used in: BELARUS.

◆ BZD

enum PECUNIA_EXPORT pecunia::BZD = 84

The currency code for the "Belize Dollar" used in: BELIZE.

◆ CAD

enum PECUNIA_EXPORT pecunia::CAD = 124

The currency code for the "Canadian Dollar" used in: CANADA.

◆ CDF

enum PECUNIA_EXPORT pecunia::CDF = 976

The currency code for the "Congolese Franc" used in: CONGO (THE DEMOCRATIC REPUBLIC OF THE).

◆ CHE

enum PECUNIA_EXPORT pecunia::CHE = 947

The currency code for the "WIR Euro" used in: SWITZERLAND.

◆ CHF

enum PECUNIA_EXPORT pecunia::CHF = 756

The currency code for the "Swiss Franc" used in: LIECHTENSTEIN; SWITZERLAND.

◆ CHW

enum PECUNIA_EXPORT pecunia::CHW = 948

The currency code for the "WIR Franc" used in: SWITZERLAND.

◆ CLF

enum PECUNIA_EXPORT pecunia::CLF = 990

The currency code for the "Unidad de Fomento" used in: CHILE.

◆ CLP

enum PECUNIA_EXPORT pecunia::CLP = 152

The currency code for the "Chilean Peso" used in: CHILE.

◆ CNY

enum PECUNIA_EXPORT pecunia::CNY = 156

The currency code for the "Yuan Renminbi" used in: CHINA.

◆ COP

enum PECUNIA_EXPORT pecunia::COP = 170

The currency code for the "Colombian Peso" used in: COLOMBIA.

◆ COU

enum PECUNIA_EXPORT pecunia::COU = 970

The currency code for the "Unidad de Valor Real" used in: COLOMBIA.

◆ CRC

enum PECUNIA_EXPORT pecunia::CRC = 188

The currency code for the "Costa Rican Colon" used in: COSTA RICA.

◆ CUP

enum PECUNIA_EXPORT pecunia::CUP = 192

The currency code for the "Cuban Peso" used in: CUBA.

◆ Currency

enum PECUNIA_EXPORT pecunia::Currency
strong

The unique identifier for a country's currency, monetary market, etc. using the ISO-4217 standard.

See also
ISO-4217 https://en.wikipedia.org/wiki/ISO_4217

◆ CVE

enum PECUNIA_EXPORT pecunia::CVE = 132

The currency code for the "Cabo Verde Escudo" used in: CABO VERDE.

◆ CZK

enum PECUNIA_EXPORT pecunia::CZK = 203

The currency code for the "Czech Koruna" used in: CZECHIA.

◆ DJF

enum PECUNIA_EXPORT pecunia::DJF = 262

The currency code for the "Djibouti Franc" used in: DJIBOUTI.

◆ DKK

enum PECUNIA_EXPORT pecunia::DKK = 208

The currency code for the "Danish Krone" used in: DENMARK; FAROE ISLANDS (THE); GREENLAND.

◆ DOP

enum PECUNIA_EXPORT pecunia::DOP = 214

The currency code for the "Dominican Peso" used in: DOMINICAN REPUBLIC (THE).

◆ DZD

enum PECUNIA_EXPORT pecunia::DZD = 12

The currency code for the "Algerian Dinar" used in: ALGERIA.

◆ EGP

enum PECUNIA_EXPORT pecunia::EGP = 818

The currency code for the "Egyptian Pound" used in: EGYPT.

◆ ERN

enum PECUNIA_EXPORT pecunia::ERN = 232

The currency code for the "Nakfa" used in: ERITREA.

◆ ETB

enum PECUNIA_EXPORT pecunia::ETB = 230

The currency code for the "Ethiopian Birr" used in: ETHIOPIA.

◆ EUR

enum PECUNIA_EXPORT pecunia::EUR = 978

The currency code for the "Euro" used in: ANDORRA; AUSTRIA; BELGIUM; CROATIA; CYPRUS; ESTONIA; EUROPEAN UNION; FINLAND; FRANCE; FRENCH GUIANA; FRENCH SOUTHERN TERRITORIES (THE); GERMANY; GREECE; GUADELOUPE; HOLY SEE (THE); IRELAND; ITALY; LATVIA; LITHUANIA; LUXEMBOURG; MALTA; MARTINIQUE; MAYOTTE; MONACO; MONTENEGRO; NETHERLANDS (THE); PORTUGAL; RÉUNION; SAINT BARTHÉLEMY; SAINT MARTIN (FRENCH PART); SAINT PIERRE AND MIQUELON; SAN MARINO; SLOVAKIA; SLOVENIA; SPAIN; ÅLAND ISLANDS.

◆ FJD

enum PECUNIA_EXPORT pecunia::FJD = 242

The currency code for the "Fiji Dollar" used in: FIJI.

◆ FKP

enum PECUNIA_EXPORT pecunia::FKP = 238

The currency code for the "Falkland Islands Pound" used in: FALKLAND ISLANDS (THE) [MALVINAS].

◆ GBP

enum PECUNIA_EXPORT pecunia::GBP = 826

The currency code for the "Pound Sterling" used in: GUERNSEY; ISLE OF MAN; JERSEY; UNITED KINGDOM OF GREAT BRITAIN AND NORTHERN IRELAND (THE).

◆ GEL

enum PECUNIA_EXPORT pecunia::GEL = 981

The currency code for the "Lari" used in: GEORGIA.

◆ GHS

enum PECUNIA_EXPORT pecunia::GHS = 936

The currency code for the "Ghana Cedi" used in: GHANA.

◆ GIP

enum PECUNIA_EXPORT pecunia::GIP = 292

The currency code for the "Gibraltar Pound" used in: GIBRALTAR.

◆ GMD

enum PECUNIA_EXPORT pecunia::GMD = 270

The currency code for the "Dalasi" used in: GAMBIA (THE).

◆ GNF

enum PECUNIA_EXPORT pecunia::GNF = 324

The currency code for the "Guinean Franc" used in: GUINEA.

◆ GTQ

enum PECUNIA_EXPORT pecunia::GTQ = 320

The currency code for the "Quetzal" used in: GUATEMALA.

◆ GYD

enum PECUNIA_EXPORT pecunia::GYD = 328

The currency code for the "Guyana Dollar" used in: GUYANA.

◆ HKD

enum PECUNIA_EXPORT pecunia::HKD = 344

The currency code for the "Hong Kong Dollar" used in: HONG KONG.

◆ HNL

enum PECUNIA_EXPORT pecunia::HNL = 340

The currency code for the "Lempira" used in: HONDURAS.

◆ HTG

enum PECUNIA_EXPORT pecunia::HTG = 332

The currency code for the "Gourde" used in: HAITI.

◆ HUF

enum PECUNIA_EXPORT pecunia::HUF = 348

The currency code for the "Forint" used in: HUNGARY.

◆ IDR

enum PECUNIA_EXPORT pecunia::IDR = 360

The currency code for the "Rupiah" used in: INDONESIA.

◆ ILS

enum PECUNIA_EXPORT pecunia::ILS = 376

The currency code for the "New Israeli Sheqel" used in: ISRAEL.

◆ INR

enum PECUNIA_EXPORT pecunia::INR = 356

The currency code for the "Indian Rupee" used in: BHUTAN; INDIA.

◆ IQD

enum PECUNIA_EXPORT pecunia::IQD = 368

The currency code for the "Iraqi Dinar" used in: IRAQ.

◆ IRR

enum PECUNIA_EXPORT pecunia::IRR = 364

The currency code for the "Iranian Rial" used in: IRAN (ISLAMIC REPUBLIC OF).

◆ ISK

enum PECUNIA_EXPORT pecunia::ISK = 352

The currency code for the "Iceland Krona" used in: ICELAND.

◆ isoCurrencySize

auto pecunia::isoCurrencySize {3}
inlineconstexpr

The number of characters in an ISO-4217 currency code string.

◆ JMD

enum PECUNIA_EXPORT pecunia::JMD = 388

The currency code for the "Jamaican Dollar" used in: JAMAICA.

◆ JOD

enum PECUNIA_EXPORT pecunia::JOD = 400

The currency code for the "Jordanian Dinar" used in: JORDAN.

◆ JPY

enum PECUNIA_EXPORT pecunia::JPY = 392

The currency code for the "Yen" used in: JAPAN.

◆ KES

enum PECUNIA_EXPORT pecunia::KES = 404

The currency code for the "Kenyan Shilling" used in: KENYA.

◆ KGS

enum PECUNIA_EXPORT pecunia::KGS = 417

The currency code for the "Som" used in: KYRGYZSTAN.

◆ KHR

enum PECUNIA_EXPORT pecunia::KHR = 116

The currency code for the "Riel" used in: CAMBODIA.

◆ KMF

enum PECUNIA_EXPORT pecunia::KMF = 174

The currency code for the "Comorian Franc " used in: COMOROS (THE).

◆ KPW

enum PECUNIA_EXPORT pecunia::KPW = 408

The currency code for the "North Korean Won" used in: KOREA (THE DEMOCRATIC PEOPLE’S REPUBLIC OF).

◆ KRW

enum PECUNIA_EXPORT pecunia::KRW = 410

The currency code for the "Won" used in: KOREA (THE REPUBLIC OF).

◆ KWD

enum PECUNIA_EXPORT pecunia::KWD = 414

The currency code for the "Kuwaiti Dinar" used in: KUWAIT.

◆ KYD

enum PECUNIA_EXPORT pecunia::KYD = 136

The currency code for the "Cayman Islands Dollar" used in: CAYMAN ISLANDS (THE).

◆ KZT

enum PECUNIA_EXPORT pecunia::KZT = 398

The currency code for the "Tenge" used in: KAZAKHSTAN.

◆ LAK

enum PECUNIA_EXPORT pecunia::LAK = 418

The currency code for the "Lao Kip" used in: LAO PEOPLE’S DEMOCRATIC REPUBLIC (THE).

◆ LBP

enum PECUNIA_EXPORT pecunia::LBP = 422

The currency code for the "Lebanese Pound" used in: LEBANON.

◆ LKR

enum PECUNIA_EXPORT pecunia::LKR = 144

The currency code for the "Sri Lanka Rupee" used in: SRI LANKA.

◆ LRD

enum PECUNIA_EXPORT pecunia::LRD = 430

The currency code for the "Liberian Dollar" used in: LIBERIA.

◆ LSL

enum PECUNIA_EXPORT pecunia::LSL = 426

The currency code for the "Loti" used in: LESOTHO.

◆ LYD

enum PECUNIA_EXPORT pecunia::LYD = 434

The currency code for the "Libyan Dinar" used in: LIBYA.

◆ MAD

enum PECUNIA_EXPORT pecunia::MAD = 504

The currency code for the "Moroccan Dirham" used in: MOROCCO; WESTERN SAHARA.

◆ MDL

enum PECUNIA_EXPORT pecunia::MDL = 498

The currency code for the "Moldovan Leu" used in: MOLDOVA (THE REPUBLIC OF).

◆ MGA

enum PECUNIA_EXPORT pecunia::MGA = 969

The currency code for the "Malagasy Ariary" used in: MADAGASCAR.

◆ MKD

enum PECUNIA_EXPORT pecunia::MKD = 807

The currency code for the "Denar" used in: NORTH MACEDONIA.

◆ MMK

enum PECUNIA_EXPORT pecunia::MMK = 104

The currency code for the "Kyat" used in: MYANMAR.

◆ MNT

enum PECUNIA_EXPORT pecunia::MNT = 496

The currency code for the "Tugrik" used in: MONGOLIA.

◆ MOP

enum PECUNIA_EXPORT pecunia::MOP = 446

The currency code for the "Pataca" used in: MACAO.

◆ MRU

enum PECUNIA_EXPORT pecunia::MRU = 929

The currency code for the "Ouguiya" used in: MAURITANIA.

◆ MUR

enum PECUNIA_EXPORT pecunia::MUR = 480

The currency code for the "Mauritius Rupee" used in: MAURITIUS.

◆ MVR

enum PECUNIA_EXPORT pecunia::MVR = 462

The currency code for the "Rufiyaa" used in: MALDIVES.

◆ MWK

enum PECUNIA_EXPORT pecunia::MWK = 454

The currency code for the "Malawi Kwacha" used in: MALAWI.

◆ MXN

enum PECUNIA_EXPORT pecunia::MXN = 484

The currency code for the "Mexican Peso" used in: MEXICO.

◆ MXV

enum PECUNIA_EXPORT pecunia::MXV = 979

The currency code for the "Mexican Unidad de Inversion (UDI)" used in: MEXICO.

◆ MYR

enum PECUNIA_EXPORT pecunia::MYR = 458

The currency code for the "Malaysian Ringgit" used in: MALAYSIA.

◆ MZN

enum PECUNIA_EXPORT pecunia::MZN = 943

The currency code for the "Mozambique Metical" used in: MOZAMBIQUE.

◆ NAD

enum PECUNIA_EXPORT pecunia::NAD = 516

The currency code for the "Namibia Dollar" used in: NAMIBIA.

◆ NGN

enum PECUNIA_EXPORT pecunia::NGN = 566

The currency code for the "Naira" used in: NIGERIA.

◆ NIO

enum PECUNIA_EXPORT pecunia::NIO = 558

The currency code for the "Cordoba Oro" used in: NICARAGUA.

◆ NOK

enum PECUNIA_EXPORT pecunia::NOK = 578

The currency code for the "Norwegian Krone" used in: BOUVET ISLAND; NORWAY; SVALBARD AND JAN MAYEN.

◆ NPR

enum PECUNIA_EXPORT pecunia::NPR = 524

The currency code for the "Nepalese Rupee" used in: NEPAL.

◆ NZD

enum PECUNIA_EXPORT pecunia::NZD = 554

The currency code for the "New Zealand Dollar" used in: COOK ISLANDS (THE); NEW ZEALAND; NIUE; PITCAIRN; TOKELAU.

◆ OMR

enum PECUNIA_EXPORT pecunia::OMR = 512

The currency code for the "Rial Omani" used in: OMAN.

◆ PAB

enum PECUNIA_EXPORT pecunia::PAB = 590

The currency code for the "Balboa" used in: PANAMA.

◆ PEN

enum PECUNIA_EXPORT pecunia::PEN = 604

The currency code for the "Sol" used in: PERU.

◆ PGK

enum PECUNIA_EXPORT pecunia::PGK = 598

The currency code for the "Kina" used in: PAPUA NEW GUINEA.

◆ PHP

enum PECUNIA_EXPORT pecunia::PHP = 608

The currency code for the "Philippine Peso" used in: PHILIPPINES (THE).

◆ PKR

enum PECUNIA_EXPORT pecunia::PKR = 586

The currency code for the "Pakistan Rupee" used in: PAKISTAN.

◆ PLN

enum PECUNIA_EXPORT pecunia::PLN = 985

The currency code for the "Zloty" used in: POLAND.

◆ PYG

enum PECUNIA_EXPORT pecunia::PYG = 600

The currency code for the "Guarani" used in: PARAGUAY.

◆ QAR

enum PECUNIA_EXPORT pecunia::QAR = 634

The currency code for the "Qatari Rial" used in: QATAR.

◆ RON

enum PECUNIA_EXPORT pecunia::RON = 946

The currency code for the "Romanian Leu" used in: ROMANIA.

◆ RSD

enum PECUNIA_EXPORT pecunia::RSD = 941

The currency code for the "Serbian Dinar" used in: SERBIA.

◆ RUB

enum PECUNIA_EXPORT pecunia::RUB = 643

The currency code for the "Russian Ruble" used in: RUSSIAN FEDERATION (THE).

◆ RWF

enum PECUNIA_EXPORT pecunia::RWF = 646

The currency code for the "Rwanda Franc" used in: RWANDA.

◆ SAR

enum PECUNIA_EXPORT pecunia::SAR = 682

The currency code for the "Saudi Riyal" used in: SAUDI ARABIA.

◆ SBD

enum PECUNIA_EXPORT pecunia::SBD = 90

The currency code for the "Solomon Islands Dollar" used in: SOLOMON ISLANDS.

◆ SCR

enum PECUNIA_EXPORT pecunia::SCR = 690

The currency code for the "Seychelles Rupee" used in: SEYCHELLES.

◆ SDG

enum PECUNIA_EXPORT pecunia::SDG = 938

The currency code for the "Sudanese Pound" used in: SUDAN (THE).

◆ SEK

enum PECUNIA_EXPORT pecunia::SEK = 752

The currency code for the "Swedish Krona" used in: SWEDEN.

◆ SGD

enum PECUNIA_EXPORT pecunia::SGD = 702

The currency code for the "Singapore Dollar" used in: SINGAPORE.

◆ SHP

enum PECUNIA_EXPORT pecunia::SHP = 654

The currency code for the "Saint Helena Pound" used in: SAINT HELENA, ASCENSION AND TRISTAN DA CUNHA.

◆ SLE

enum PECUNIA_EXPORT pecunia::SLE = 925

The currency code for the "Leone" used in: SIERRA LEONE.

◆ SOS

enum PECUNIA_EXPORT pecunia::SOS = 706

The currency code for the "Somali Shilling" used in: SOMALIA.

◆ SRD

enum PECUNIA_EXPORT pecunia::SRD = 968

The currency code for the "Surinam Dollar" used in: SURINAME.

◆ SSP

enum PECUNIA_EXPORT pecunia::SSP = 728

The currency code for the "South Sudanese Pound" used in: SOUTH SUDAN.

◆ STN

enum PECUNIA_EXPORT pecunia::STN = 930

The currency code for the "Dobra" used in: SAO TOME AND PRINCIPE.

◆ SVC

enum PECUNIA_EXPORT pecunia::SVC = 222

The currency code for the "El Salvador Colon" used in: EL SALVADOR.

◆ SYP

enum PECUNIA_EXPORT pecunia::SYP = 760

The currency code for the "Syrian Pound" used in: SYRIAN ARAB REPUBLIC.

◆ SZL

enum PECUNIA_EXPORT pecunia::SZL = 748

The currency code for the "Lilangeni" used in: ESWATINI.

◆ THB

enum PECUNIA_EXPORT pecunia::THB = 764

The currency code for the "Baht" used in: THAILAND.

◆ TJS

enum PECUNIA_EXPORT pecunia::TJS = 972

The currency code for the "Somoni" used in: TAJIKISTAN.

◆ TMT

enum PECUNIA_EXPORT pecunia::TMT = 934

The currency code for the "Turkmenistan New Manat" used in: TURKMENISTAN.

◆ TND

enum PECUNIA_EXPORT pecunia::TND = 788

The currency code for the "Tunisian Dinar" used in: TUNISIA.

◆ TOP

enum PECUNIA_EXPORT pecunia::TOP = 776

The currency code for the "Pa’anga" used in: TONGA.

◆ TRY

enum PECUNIA_EXPORT pecunia::TRY = 949

The currency code for the "Turkish Lira" used in: TÜRKİYE.

◆ TTD

enum PECUNIA_EXPORT pecunia::TTD = 780

The currency code for the "Trinidad and Tobago Dollar" used in: TRINIDAD AND TOBAGO.

◆ TWD

enum PECUNIA_EXPORT pecunia::TWD = 901

The currency code for the "New Taiwan Dollar" used in: TAIWAN (PROVINCE OF CHINA).

◆ TZS

enum PECUNIA_EXPORT pecunia::TZS = 834

The currency code for the "Tanzanian Shilling" used in: TANZANIA, UNITED REPUBLIC OF.

◆ UAH

enum PECUNIA_EXPORT pecunia::UAH = 980

The currency code for the "Hryvnia" used in: UKRAINE.

◆ UGX

enum PECUNIA_EXPORT pecunia::UGX = 800

The currency code for the "Uganda Shilling" used in: UGANDA.

◆ unexpectedErr

struct pecunia::PECUNIA_EXPORT pecunia::unexpectedErr
static

◆ USD

enum PECUNIA_EXPORT pecunia::USD = 840

The currency code for the "US Dollar" used in: AMERICAN SAMOA; BONAIRE, SINT EUSTATIUS AND SABA; BRITISH INDIAN OCEAN TERRITORY (THE); ECUADOR; EL SALVADOR; GUAM; HAITI; MARSHALL ISLANDS (THE); MICRONESIA (FEDERATED STATES OF); NORTHERN MARIANA ISLANDS (THE); PALAU; PANAMA; PUERTO RICO; TIMOR-LESTE; TURKS AND CAICOS ISLANDS (THE); UNITED STATES MINOR OUTLYING ISLANDS (THE); UNITED STATES OF AMERICA (THE); VIRGIN ISLANDS (BRITISH); VIRGIN ISLANDS (U.S.).

◆ USN

enum PECUNIA_EXPORT pecunia::USN = 997

The currency code for the "US Dollar (Next day)" used in: UNITED STATES OF AMERICA (THE).

◆ UYI

enum PECUNIA_EXPORT pecunia::UYI = 940

The currency code for the "Uruguay Peso en Unidades Indexadas (UI)" used in: URUGUAY.

◆ UYU

enum PECUNIA_EXPORT pecunia::UYU = 858

The currency code for the "Peso Uruguayo" used in: URUGUAY.

◆ UYW

enum PECUNIA_EXPORT pecunia::UYW = 927

The currency code for the "Unidad Previsional" used in: URUGUAY.

◆ UZS

enum PECUNIA_EXPORT pecunia::UZS = 860

The currency code for the "Uzbekistan Sum" used in: UZBEKISTAN.

◆ VED

enum PECUNIA_EXPORT pecunia::VED = 926

The currency code for the "Bolívar Soberano" used in: VENEZUELA (BOLIVARIAN REPUBLIC OF).

◆ VES

enum PECUNIA_EXPORT pecunia::VES = 928

The currency code for the "Bolívar Soberano" used in: VENEZUELA (BOLIVARIAN REPUBLIC OF).

◆ VND

enum PECUNIA_EXPORT pecunia::VND = 704

The currency code for the "Dong" used in: VIET NAM.

◆ VUV

enum PECUNIA_EXPORT pecunia::VUV = 548

The currency code for the "Vatu" used in: VANUATU.

◆ WST

enum PECUNIA_EXPORT pecunia::WST = 882

The currency code for the "Tala" used in: SAMOA.

◆ XAD

enum PECUNIA_EXPORT pecunia::XAD = 396

The currency code for the "Arab Accounting Dinar" used in: ARAB MONETARY FUND.

◆ XAF

enum PECUNIA_EXPORT pecunia::XAF = 950

The currency code for the "CFA Franc BEAC" used in: CAMEROON; CENTRAL AFRICAN REPUBLIC (THE); CHAD; CONGO (THE); EQUATORIAL GUINEA; GABON.

◆ XAG

enum PECUNIA_EXPORT pecunia::XAG = 961

The currency code for the "Silver" used in: ZZ11_Silver.

◆ XAU

enum PECUNIA_EXPORT pecunia::XAU = 959

The currency code for the "Gold" used in: ZZ08_Gold.

◆ XBA

enum PECUNIA_EXPORT pecunia::XBA = 955

The currency code for the "Bond Markets Unit European Composite Unit (EURCO)" used in: ZZ01_Bond Markets Unit European_EURCO.

◆ XBB

enum PECUNIA_EXPORT pecunia::XBB = 956

The currency code for the "Bond Markets Unit European Monetary Unit (E.M.U.-6)" used in: ZZ02_Bond Markets Unit European_EMU-6.

◆ XBC

enum PECUNIA_EXPORT pecunia::XBC = 957

The currency code for the "Bond Markets Unit European Unit of Account 9 (E.U.A.-9)" used in: ZZ03_Bond Markets Unit European_EUA-9.

◆ XBD

enum PECUNIA_EXPORT pecunia::XBD = 958

The currency code for the "Bond Markets Unit European Unit of Account 17 (E.U.A.-17)" used in: ZZ04_Bond Markets Unit European_EUA-17.

◆ XCD

enum PECUNIA_EXPORT pecunia::XCD = 951

The currency code for the "East Caribbean Dollar" used in: ANGUILLA; ANTIGUA AND BARBUDA; DOMINICA; GRENADA; MONTSERRAT; SAINT KITTS AND NEVIS; SAINT LUCIA; SAINT VINCENT AND THE GRENADINES.

◆ XCG

enum PECUNIA_EXPORT pecunia::XCG = 532

The currency code for the "Caribbean Guilder" used in: CURAÇAO; SINT MAARTEN (DUTCH PART).

◆ XDR

enum PECUNIA_EXPORT pecunia::XDR = 960

The currency code for the "SDR (Special Drawing Right)" used in: INTERNATIONAL MONETARY FUND (IMF) .

◆ XOF

enum PECUNIA_EXPORT pecunia::XOF = 952

The currency code for the "CFA Franc BCEAO" used in: BENIN; BURKINA FASO; CÔTE D'IVOIRE; GUINEA-BISSAU; MALI; NIGER (THE); SENEGAL; TOGO.

◆ XPD

enum PECUNIA_EXPORT pecunia::XPD = 964

The currency code for the "Palladium" used in: ZZ09_Palladium.

◆ XPF

enum PECUNIA_EXPORT pecunia::XPF = 953

The currency code for the "CFP Franc" used in: FRENCH POLYNESIA; NEW CALEDONIA; WALLIS AND FUTUNA.

◆ XPT

enum PECUNIA_EXPORT pecunia::XPT = 962

The currency code for the "Platinum" used in: ZZ10_Platinum.

◆ XSU

enum PECUNIA_EXPORT pecunia::XSU = 994

The currency code for the "Sucre" used in: SISTEMA UNITARIO DE COMPENSACION REGIONAL DE PAGOS "SUCRE".

◆ XTS

enum PECUNIA_EXPORT pecunia::XTS = 963

The currency code for the "Codes specifically reserved for testing purposes" used in: ZZ06_Testing_Code.

◆ XUA

enum PECUNIA_EXPORT pecunia::XUA = 965

The currency code for the "ADB Unit of Account" used in: MEMBER COUNTRIES OF THE AFRICAN DEVELOPMENT BANK GROUP.

◆ XXX

enum PECUNIA_EXPORT pecunia::XXX = 999

The currency code for the "The codes assigned for transactions where no currency is involved" used in: ZZ07_No_Currency.

◆ YER

enum PECUNIA_EXPORT pecunia::YER = 886

The currency code for the "Yemeni Rial" used in: YEMEN.

◆ ZAR

enum PECUNIA_EXPORT pecunia::ZAR = 710

The currency code for the "Rand" used in: LESOTHO; NAMIBIA; SOUTH AFRICA.

◆ ZMW

enum PECUNIA_EXPORT pecunia::ZMW = 967

The currency code for the "Zambian Kwacha" used in: ZAMBIA.

◆ ZWG

enum PECUNIA_EXPORT pecunia::ZWG = 924

The currency code for the "Zimbabwe Gold" used in: ZIMBABWE.