I18nEx.Currency (i18n_ex v0.0.1)

A module for formatting currencies.

Link to this section Summary

Functions

Formats the given number as a currency using the provided options. Currency and Locale will be passed within the opts paramter as :currency and :locale keys. Currency and Locale are optional, if not provided fallback to default values("USD" and "en-US").

Link to this section Functions

Link to this function

format(number, opts \\ [])

Formats the given number as a currency using the provided options. Currency and Locale will be passed within the opts paramter as :currency and :locale keys. Currency and Locale are optional, if not provided fallback to default values("USD" and "en-US").

examples

Examples

iex> I18nEx.Currency.format(1000) |> to_string()
"$1,000.00"

# iex> I18nEx.Currency.format(1000, currency: "EUR", locale: "fr-FR") |> to_string()
# "10 000,00 €"