I18nEx.Number (i18n_ex v0.0.1)

A module for formatting numbers.

Link to this section Summary

Functions

Formats the given number using the provided options. Locale will be passed within the opts paramter as locale: key. Locale is optional, if not provided fallback to default value "en-US".

Link to this section Functions

Link to this function

format(number, opts \\ [])

Formats the given number using the provided options. Locale will be passed within the opts paramter as locale: key. Locale is optional, if not provided fallback to default value "en-US".

examples

Examples

iex> I18nEx.Number.format(1000) |> to_string()
"1,000"

iex> I18nEx.Number.format(1000, locale: "fr-FR") |> to_string()
"1 000"