Intl.Currency

A Currency is used to the display numeric data as money. Note that NumberFormat does not do exchange currency conversion, it only uses the currency for displaying symbols and other conventions to mark the number as money.

type Currency

The Currency type holds a valid ISO 4217 currency code.

fromCurrencyCode
:
String -> Maybe.Maybe Intl.Currency.Currency

Checks the string as a valid currency code, and returns a currency if it is.

-- Going back to the Gold Standard
fromCurrencyCode "XAU"

If a string is passed that is not a valid currency code, Nothing will be returned.

Note that any 3-letter string will work, but if it isn't a defined currency code, then the formatting will have no symbol or currency name. It will just use the code you provided.

toCurrencyCode
:
Intl.Currency.Currency -> String

Gets the string currency code from a Currency

toCurrencyCode Currency.eur == "EUR"

Predefined Currencies

A few currencies have been pre-defined for convenience.

usd
:
Intl.Currency.Currency

United States Dollar

Basic information
README
Browse source on Github
Elm version: 0.17.1 <= v < 0.18.0
Contains Native Module(s)
Modules
Intl.Collator
Intl.Currency
Intl.DateTimeFormat Intl.Locale Intl.NumberFormat Intl.TimeZone
Versions
1.0.0
Dependencies