Cldr.Number.Format.format_styles_for
You're seeing just the function
format_styles_for
, go back to Cldr.Number.Format module for more information.
Specs
format_styles_for( Cldr.LanguageTag.t() | Cldr.Locale.locale_name(), Cldr.Number.System.system_name(), Cldr.backend() ) :: {:ok, [atom()]} | {:error, {module(), String.t()}}
Returns the format styles available for a locale
.
Arguments
locale
is any valid locale name returned byCldr.known_locale_names/1
or aCldr.LanguageTag
struct returned byCldr.Locale.new!/2
. The default isCldr.get_locale/1
number_system
is any valid number system or number system type returned byCldr.Number.System.number_systems_for/2
backend
is anyCldr
backend. That is, any module that containsuse Cldr
Format styles standardise the access to a format defined for a common
use. These types are :standard
, :currency
, :accounting
, :scientific
and :percent, :currency_short, :decimal_short, :decimal_long.
These types can be used when formatting a number for output. For example
Cldr.Number.to_string(123.456, format: :percent)
.
Example
iex> Cldr.Number.Format.format_styles_for("en", :latn, MyApp.Cldr)
{:ok, [:accounting, :currency, :currency_long, :currency_short,
:decimal_long, :decimal_short, :percent, :scientific, :standard]}