Cldr.Number.Format.Options (Cldr Numbers v2.17.0-rc.0) View Source

Functions to validate and transform options that guide number formatting

Link to this section Summary

Link to this section Types

Specs

currency_symbol() :: :standard | :iso

Specs

fixed_formats() :: :standard | :currency | :accounting | :short | :long

Specs

format() :: binary() | fixed_formats()

Specs

short_format_styles() ::
  :currency_short | :currency_long | :decimal_short | :decimal_long

Specs

t() :: %Cldr.Number.Format.Options{
  currency: Cldr.Currency.code(),
  currency_digits: pos_integer(),
  currency_spacing: map(),
  currency_symbol: term(),
  format: format(),
  fractional_digits: pos_integer(),
  locale: Cldr.LanguageTag.t(),
  minimum_grouping_digits: pos_integer(),
  number_system: Cldr.Number.System.system_name(),
  pattern: String.t(),
  round_nearest: pos_integer(),
  rounding_mode: Decimal.rounding(),
  symbols: Cldr.Number.Symbol.t()
}

Link to this section Functions

Link to this function

confirm_currency_format_has_currency_code(options)

View Source
Link to this function

ensure_only_valid_keys(valid_options, options)

View Source
Link to this function

maybe_set_iso_currency_symbol(options)

View Source
Link to this function

resolve_standard_format(options, backend)

View Source
Link to this function

set_pattern(options, number)

View Source

Specs

short_format_styles() :: [atom()]
Link to this function

structify(options, module)

View Source
Link to this function

validate_option(arg1, options, backend, locale)

View Source
Link to this function

validate_options(number, backend, options)

View Source

Specs

validate_options(Cldr.Math.number_or_decimal(), Cldr.backend(), [
  {atom(), term()}
]) :: {:ok, t()} | {:error, {module(), String.t()}}
Link to this function

validate_other_format(other_type, backend, options)

View Source