Search documentation of bb

# BB.Cldr.Number.Symbol (bb v0.8.0)

View Source

# Summary

## Functions

all_decimal_symbols()

Returns a list of all decimal symbols defined by the locales configured in this backend as a list.

all_decimal_symbols_class()

Returns a list of all decimal symbols defined by the locales configured in this backend as a string.

all_grouping_symbols()

Returns a list of all grouping symbols defined by the locales configured in this backend as a list.

all_grouping_symbols_class()

Returns a list of all grouping symbols defined by the locales configured in this backend as a string.

number_symbols_for(locale \\ BB.Cldr.get_locale())

Returns a map of `Cldr.Number.Symbol.t` structs of the number symbols for each of the number systems of a locale.

number_symbols_for(locale, number_system)

# Functions

# all_decimal_symbols()

Returns a list of all decimal symbols defined by the locales configured in this backend as a list.

# all_decimal_symbols_class()

Returns a list of all decimal symbols defined by the locales configured in this backend as a string.

This string can be used as a character class when builing a regular expression.

# all_grouping_symbols()

Returns a list of all grouping symbols defined by the locales configured in this backend as a list.

# all_grouping_symbols_class()

Returns a list of all grouping symbols defined by the locales configured in this backend as a string.

This string can be used as a character class when builing a regular expression.

# number_symbols_for(locale \\ BB.Cldr.get_locale())

    @spec number_symbols_for(Cldr.LanguageTag.t() | Cldr.Locale.locale_name()) ::
      {:ok, map()} | {:error, {module(), String.t()}}

Returns a map of `Cldr.Number.Symbol.t` structs of the number symbols for each of the number systems of a locale.

## Options

- `locale` is any valid locale name returned by `BB.Cldr.known_locale_names/0` or a `Cldr.LanguageTag` struct returned by `BB.Cldr.Locale.new!/1`. The default is `BB.Cldr.get_locale/0`.

## Example:

    iex> BB.Cldr.Number.Symbol.number_symbols_for(:th)
    {
      :ok,
      %{
        latn: %Cldr.Number.Symbol{
          decimal: %{standard: "."},
          exponential: "E",
          group: %{standard: ","},
          infinity: "∞",
          list: ";",
          minus_sign: "-",
          nan: "NaN",
          per_mille: "‰",
          percent_sign: "%",
          plus_sign: "+",
          superscripting_exponent: "×",
          time_separator: ":"
        },
        thai: %Cldr.Number.Symbol{
          decimal: %{standard: "."},
          exponential: "E",
          group: %{standard: ","},
          infinity: "∞",
          list: ";",
          minus_sign: "-",
          nan: "NaN",
          per_mille: "‰",
          percent_sign: "%",
          plus_sign: "+",
          superscripting_exponent: "×",
          time_separator: ":"
        }
      }
    }

# number_symbols_for(locale, number_system)