cldr_currencies {i18n}R Documentation

Get a single localized value from the currencies dataset

Description

The currencies table contains information of currency codes and localized display names and symbols across 574 locales. The cldr_currencies() function allows one to extract a single element value from the table by supplying the locale, the currency code (currency), and one of the following element names:

Usage

cldr_currencies(
  locale = "en",
  currency = currency_code_list$USD,
  element = currencies_elements$currency_symbol
)

Arguments

locale

The locale ID for which to obtain the data from the currencies table.

currency

The currency code (e.g., "USD", "EUR", etc.). A valid set of currency codes can be accessed through the currency_code_list object.

element

The element from which information will be obtained for the specified locale. A valid set of currency elements can be accessed through the currencies_elements list object.

Value

A length one character vector.

Examples

If you would like to get the currency display name for the British Pound ("GBP") currency while in the "de" locale, the following invocation of cldr_currencies() can be used.

cldr_currencies(
  locale = "de",
  currency = currency_code_list$GBP,
  element = currencies_elements$currency_display_name
)
#> [1] "Britisches Pfund"

[Package i18n version 0.2.0 Index]