Cldr Numbers v1.4.1 Cldr.Number.Symbol View Source

Functions to manage the symbol definitions for a locale and number system.

Link to this section Summary

Functions

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

Returns the number sysbols for a specific locale and number system

Link to this section Functions

Link to this function number_symbols_for(locale \\ Cldr.get_current_locale()) View Source
number_symbols_for(Cldr.LanguageTag.t() | Cldr.Locale.locale_name()) ::
  Keyword.t()

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

Options

Example:

iex> Cldr.Number.Symbol.number_symbols_for("th")
{:ok, %{
   latn: %Cldr.Number.Symbol{
     decimal: ".",
     exponential: "E",
     group: ",",
     infinity: "∞",
     list: ";",
     minus_sign: "-",
     nan: "NaN",
     per_mille: "‰",
     percent_sign: "%",
     plus_sign: "+",
     superscripting_exponent: "×",
     time_separator: ":"
   },
   thai: %Cldr.Number.Symbol{
     decimal: ".",
     exponential: "E",
     group: ",",
     infinity: "∞",
     list: ";",
     minus_sign: "-",
     nan: "NaN",
     per_mille: "‰",
     percent_sign: "%",
     plus_sign: "+",
     superscripting_exponent: "×",
     time_separator: ":"
   }
 }}
Link to this function number_symbols_for(locale, number_system) View Source
number_symbols_for(
  Cldr.LanguageTag.t() | Cldr.Locale.locale_name(),
  System.system_name()
) :: {:ok, Map.t()} | {:error, {Cldr.NoNumberSymbols, String.t()}}

Returns the number sysbols for a specific locale and number system.

Options

Example

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