| 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:
-
"currency_symbol" -
"currency_symbol_narrow" -
"currency_display_name" -
"currency_display_name_count_1" -
"currency_display_name_count_other"
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., |
element |
The element from which information will be obtained for the
specified |
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"