# `Localize.Inputs.Number.Symbols`
[🔗](https://github.com/elixir-localize/localize_number_inputs/blob/v0.1.1/lib/localize/inputs/number/symbols.ex#L1)

Locale-derived display data for number form inputs.

Returns the decimal/grouping separator characters, the active
number system, and the locale's minus sign — everything a JS
hook needs to render a number in the user's locale.

All locale lookups go through `Localize.validate_locale/1`;
the resulting `t:Localize.LanguageTag.t/0`'s
`:cldr_locale_id` is the canonical id reported back. Number
system resolution goes through
`Localize.Number.System.number_system_from_locale/1` so
Arabic-Indic, Persian, and other non-Latin digit systems work
out of the box.

# `t`

```elixir
@type t() :: %Localize.Inputs.Number.Symbols{
  decimal: String.t(),
  group: String.t(),
  language_tag: Localize.LanguageTag.t(),
  locale: atom(),
  minus_sign: String.t(),
  number_system: atom()
}
```

Locale display data resolved by `number_for_locale/1`.

* `:locale` — the canonical CLDR locale id (atom).

* `:language_tag` — the full `t:Localize.LanguageTag.t/0`.

* `:number_system` — the active number system (`:latn`,
  `:arab`, `:arabext`, …).

* `:decimal` — the locale's decimal separator character.

* `:group` — the locale's grouping separator character.

* `:minus_sign` — the locale's minus sign character.

# `number_for_locale`

```elixir
@spec number_for_locale(Localize.LanguageTag.t() | atom() | String.t() | nil) ::
  {:ok, t()} | {:error, Exception.t()}
```

Resolves display data for the given locale.

### Arguments

* `locale` is a locale identifier (atom, string, or
  `t:Localize.LanguageTag.t/0`). Defaults to
  `Localize.get_locale/0`.

### Returns

* `{:ok, t()}` on success.

* `{:error, Exception.t()}` when the locale can't be parsed
  (`Localize.InvalidLocaleError`), the number system can't be
  resolved, or no symbols are available
  (`Localize.Inputs.Number.NoNumberSymbolsError`).

### Examples

    iex> {:ok, info} = Localize.Inputs.Number.Symbols.number_for_locale(:en)
    iex> {info.decimal, info.group, info.number_system}
    {".", ",", :latn}

    iex> {:ok, info} = Localize.Inputs.Number.Symbols.number_for_locale(:de)
    iex> {info.decimal, info.group}
    {",", "."}

---

*Consult [api-reference.md](api-reference.md) for complete listing*
