dime
Types
Types of errors that can be encountered when parsing a currency from it’s code (alpha or numeric).
pub type CurrencyCodeError {
InvalidFormat
UnrecognizedCode
}
Constructors
-
InvalidFormat
-
UnrecognizedCode
Constants
Functions
pub fn alpha_code(currency: Currency) -> String
Get the 3 character alphabetic code for the currency.
pub fn display_name(currency: Currency) -> String
Get the display name of the currency in English.
pub fn from_alpha_code(
currency_code: String,
) -> Result(Currency, CurrencyCodeError)
Try and retrieve a currency by it’s 3 character alphabetic code.
pub fn from_numeric_code(
currency_code: String,
) -> Result(Currency, CurrencyCodeError)
Try and retrieve a currency by it’s 3 character numeric code.
pub fn known_currencies() -> List(Currency)
Retrieve the list of all the currencies known to this library.
pub fn minor_units(currency: Currency) -> Int
The decimal relationship between the currency and it’s minor unit, e.g. euro and euro cent.
1, 2 and 3 signify a ratio of 10:1, 100:1 and 1000:1 respectively.
pub fn numeric_code(currency: Currency) -> String
Get the 3 character numeric code for the currency.