numWord: Convert numbers to English words

View source: R/numWord.R

numWordR Documentation

Convert numbers to English words

Description

Convert numbers to English words

Usage

numWord(x, cap = FALSE, hyphen = TRUE, and = FALSE, round = FALSE)

Arguments

x

integer vector

cap

logical, if TRUE capitalise first letter of word.

hyphen

logical, if TRUE insert - between 21 and 99 (except 30, 40, etc.).

and

logical, if TRUE insert and between hundreds and tens, e.g. 110 as “one hundred and ten”

round

logical, if TRUE decimals are rounded to integers, using round(). If FALSE, decimals cause failure

Value

character vector.

Examples

numWord(0, cap = TRUE)
numWord(0:121, and = TRUE)
numWord(1e6)
numWord(1e11+12345678)
numWord(-987654321)
numWord(1e15-1)
numWord(c(1,2,3,4.55), round = TRUE)

johngodlee/JLGMisc documentation built on June 29, 2024, 9:15 p.m.