articlebeforenumber: Indefinite Article Preceding A Number

View source: R/utiltext.R

articlebeforenumberR Documentation

Indefinite Article Preceding A Number

Description

Determines the indefinite article (an or a) which should precede a given number, if the number is read out in English.

Usage

articlebeforenumber(k, teenhundreds=FALSE)

Arguments

k

A single number.

teenhundreds

Logical value specifying that (for example) 1800 should be read as “eighteen hundred” instead of “one thousand eight hundred”. See Details.

Details

This function applies the rule that, if the English language word or phrase for the number k begins with a vowel, then it should be preceded by an, and otherwise by a.

If teenhundreds=FALSE (the default), the numbers 1100 and 1800 will be read as ‘one thousand one hundred’ and ‘one thousand eight hundred’, and the indefinite article will be a. However if teenhundreds=TRUE, the numbers 1100 and 1800 be read as ‘eleven hundred’ and ‘eighteen hundred’ and the indefinite article will be an.

Value

One of the character strings "an" or "a".

Author(s)

\adrian

.

See Also

ordinal

Examples

  f <- function(k) cat(paste(articlebeforenumber(k),
                       paste0(k, "-fold"),
                       "increase\n"))
  f(8)
  f(18)
  f(28)

spatstat.utils documentation built on Oct. 24, 2023, 9:08 a.m.