Description Usage Arguments Value Examples
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.
1 | grattan_percent(number, digits = 1, .percent.suffix = "~per~cent")
|
number |
A length-one numeric vector. |
digits |
Passed to |
.percent.suffix |
What to use for the suffix of the number. |
For grattan_percent
, the number multiplied by 100, with rounding provided by scales::comma
and then the suffix.
1 | grattan_percent(2/3, digits = 0)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.