Functions to manage the number symbol definitions for a locale and number system.
Number symbols define the characters used for decimal separators,
grouping separators, percent signs, and other formatting elements.
Each locale may define symbols for one or more number systems
(e.g., :latn, :arab, :thai).
Symbol data is retrieved at runtime from locale data via the configured locale provider.
Summary
Functions
Returns a map of Localize.Number.Symbol.t() structs of the
number symbols for each number system of a locale.
Returns the number symbols for a specific locale and number system.
Types
@type t() :: %Localize.Number.Symbol{ approximately_sign: String.t(), decimal: String.t() | map(), exponential: String.t(), group: String.t() | map(), infinity: String.t(), list: String.t(), minus_sign: String.t(), nan: String.t(), per_mille: String.t(), percent_sign: String.t(), plus_sign: String.t(), superscripting_exponent: String.t(), time_separator: String.t() }
Functions
@spec number_symbols_for(Localize.LanguageTag.t() | atom() | String.t()) :: {:ok, map()} | {:error, Exception.t()}
Returns a map of Localize.Number.Symbol.t() structs of the
number symbols for each number system of a locale.
Arguments
localeis a locale identifier atom, string, or aLocalize.LanguageTag.t/0struct.
Returns
{:ok, symbols_map}wheresymbols_mapis a map of%{system_name => Localize.Number.Symbol.t()}.{:error, exception}if the locale data cannot be loaded.
@spec number_symbols_for( Localize.LanguageTag.t() | atom() | String.t(), atom() | String.t() ) :: {:ok, t()} | {:error, Exception.t()}
Returns the number symbols for a specific locale and number system.
Arguments
localeis a locale identifier atom, string, or aLocalize.LanguageTag.t/0struct.number_systemis a number system name atom or string (e.g.,:latn,:arab).
Returns
{:ok, Localize.Number.Symbol.t()}with the symbols for the requested number system.{:error, exception}if the locale data cannot be loaded or no symbols exist for the number system.