Wrapper functions for printing nicely formatted values.
Usage
format_currency(
x,
prefix = "",
suffix = "",
big.mark = ",",
accuracy = NULL,
min_length = NULL,
...
)
format_percent(x, accuracy = 0.1, ...)
Arguments
- x
A numeric vector
- prefix, suffix
Symbols to display before and after value.
- big.mark
Character used between every 3 digits to separate thousands. The default (
NULL
) retrieves the setting from the number options.- accuracy
A number to round to. Use (e.g.)
0.01
to show 2 decimal places of precision. IfNULL
, the default, uses a heuristic that should ensure breaks have the minimum number of digits needed to show the difference between adjacent values.Applied to rescaled data.
- min_length
A numeric. Minimum number of characters of the string with the formatted value.
- ...
Other arguments passed on to
base::format()
.