Description Usage Arguments Value Examples
number
is a generic formatter for numeric values.
addCommas
is a shortcut for comma as separator for thousands, point for decimal.
addSpaces
is a shortcut for space as separator for thousands, point for decimal.
percent
a shortcut for percentages (value are multiplied by 100 and a
compPercent
returns the complement of 1, i.e. percent(1 - x)
.
1 2 3 4 5 6 7 8 9 10 | number(x, accuracy = 1, multiplier = 1, prefix = "", suffix = "",
big.mark = " ", decimal.mark = ".")
addCommas(x, accuracy = 1)
addSpaces(x, accuracy = 1)
percent(x, accuracy = 1)
compPercent(x, accuracy = 1)
|
x |
a numeric vector to format |
accuracy |
number to round to, |
multiplier |
number to multiply by (e.g. for computing percentages or thousands) |
prefix, suffix |
Symbols to display before and after value |
big.mark |
character used between every 3 digits to separate thousands |
decimal.mark |
the character to be used to indicate the numeric decimal point |
a formatted character vector
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.