Skip to contents

The numeral class extends the base numeric vectors with methods for printing them using UTF digits from other numeral systems.

Usage

numeral(x = numeric(), system = c("en", "ar", "bn", "fa", "my"))

Arguments

x

A numeric vector.

system

Two-letter language code of the desired numeral system; see details for a list of available systems. Default: "en".

Value

Vector of class numeral.

Details

The following numeral systems are currently supported:

  • "en": Western Arabic numerals (the default display in base R)

  • "ar": Eastern Arabic numerals

  • "bn": Bengali numerals

  • "fa": Persian numerals

  • "my": Burmese numerals

Examples

# Eastern Arabic numerals
numeral(1:10, "ar")
#> <numeral[10]>
#>  [1]  ١  ٢  ٣  ٤  ٥  ٦  ٧  ٨  ٩ ١٠

# Persian numerals
numeral(1:10, "fa")
#> <numeral[10]>
#>  [1]  ۱  ۲  ۳  ۴  ۵  ۶  ۷  ۸  ۹ ۱۰