Grattan_frac: English prose for small numbers

Description Usage Arguments Value

Description

When a small number is requested inline, it is often preferable to use an English expression rather than the numeral. Further, referential purity can be lost when numbers are transformed to suit printing (say by multiplying by 100 to use 'per cent'). A complement to texNum.

These functions are all of the form grattan_* to avoid namespace clashes.

Usage

1
2
3
Grattan_frac(number, hedges = c("Almost", "Over"))

grattan_frac(number, hedges = c("Almost", "Over"))

Arguments

number

A length-one numeric vector.

hedges

A length-2 character vector giving the words for a hedge (see https://en.wikipedia.org/wiki/Hedge_(linguistics)), included not to mislead but to sound natural without being inaccurate. If NULL, the nearest fraction regardless is used.

Value

For Grattan_frac and grattan_frac, the nearest fraction as an English word, sentence-case or lower-case respectively. If hedges is supplied, a phrase including the next fraction above or below it as the phrase dictates.


HughParsonage/grattanCharts documentation built on May 8, 2019, 10:52 a.m.