Cldr.Number.Format.formats_for
You're seeing just the function
formats_for
, go back to Cldr.Number.Format module for more information.
Specs
formats_for( Cldr.LanguageTag.t() | Cldr.Locale.locale_name(), atom() | String.t(), Cldr.backend() ) :: {:ok, map()} | {:error, {module(), String.t()}}
Return the predfined formats for a given locale
and number_system
.
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
orCldr.Number.System.number_system_names_for/2
backend
is anyCldr
backend. That is, any module that containsuse Cldr
Example
Cldr.Number.Format.formats_for "fr", :native, MyApp.Cldr
#=> {:ok, %Cldr.Number.Format{
accounting: "#,##0.00 ¤;(#,##0.00 ¤)",
currency: "#,##0.00 ¤",
percent: "#,##0 %",
scientific: "#E0",
standard: "#,##0.###"
currency_short: [{"1000", [one: "0 k ¤", other: "0 k ¤"]},
{"10000", [one: "00 k ¤", other: "00 k ¤"]},
{"100000", [one: "000 k ¤", other: "000 k ¤"]},
{"1000000", [one: "0 M ¤", other: "0 M ¤"]},
{"10000000", [one: "00 M ¤", other: "00 M ¤"]},
{"100000000", [one: "000 M ¤", other: "000 M ¤"]},
{"1000000000", [one: "0 Md ¤", other: "0 Md ¤"]},
{"10000000000", [one: "00 Md ¤", other: "00 Md ¤"]},
{"100000000000", [one: "000 Md ¤", other: "000 Md ¤"]},
{"1000000000000", [one: "0 Bn ¤", other: "0 Bn ¤"]},
{"10000000000000", [one: "00 Bn ¤", other: "00 Bn ¤"]},
{"100000000000000", [one: "000 Bn ¤", other: "000 Bn ¤"]}],
...
}}