Cldr.Config.territory
You're seeing just the function
territory
, go back to Cldr.Config module for more information.
Specs
territory(Cldr.Locale.territory() | String.t()) :: %{} | {:error, {module(), String.t()}}
Get territory info for a specific territory.
territory
is a string, atom or language_tag representation of a territory code in the list returned byCldr.known_territories
Returns:
- A map of the territory information or
{:error, reason}
Example
iex> Cldr.Config.territory "au"
%{
currency: [AUD: %{from: ~D[1966-02-14]}],
gdp: 1248000000000,
language_population: %{
"en" => %{official_status: "de_facto_official", population_percent: 96},
"it" => %{population_percent: 1.9},
"wbp" => %{population_percent: 0.0098},
"zh-Hant" => %{population_percent: 2.1}
},
literacy_percent: 99,
measurement_system: %{default: :metric, paper_size: :a4, temperature: :metric},
population: 25466500
}
iex> Cldr.Config.territory "abc"
{:error, {Cldr.UnknownTerritoryError, "The territory \"abc\" is unknown"}}