numbers2words: Convert Integers to Words

Description Usage Arguments Value References Examples

View source: R/numbers2words.R

Description

Convert integers into English words.

Usage

1
2
3
4
5
numbers2words(
  x,
  billion = c("US", "UK")[1],
  and = if (billion == "US") "" else "and"
)

Arguments

x

An integer vector to be converted.

billion

A character scalar indicating if "US" (default) or "UK" meaning of billion should be used.

and

A character scalar for use as a conjunction, set to "" when billion=="US" (default) and "and" otherwise.

Value

A character vector, the same length as x giving the English word(s) for the integer(s) x.

References

John Fox. 2005. How Do You Spell That Number? Rnews Volume 5(1):51-54. [link].

Examples

1
numbers2words(c(4560000000, -123, 1000, 12))

JVAdams/jvamisc documentation built on Aug. 11, 2021, 6:43 a.m.