label_dollar()
These functions are kept for backward compatibility; you should switch
to label_dollar()
for new code.
dollar_format(
accuracy = NULL,
scale = 1,
prefix = "$",
suffix = "",
big.mark = ",",
decimal.mark = ".",
trim = TRUE,
largest_with_cents = 1e+05,
negative_parens = deprecated(),
...
)dollar(
x,
accuracy = NULL,
scale = 1,
prefix = "$",
suffix = "",
big.mark = ",",
decimal.mark = ".",
trim = TRUE,
largest_with_cents = 1e+05,
negative_parens = deprecated(),
style_negative = c("hyphen", "minus", "parens"),
scale_cut = NULL,
...
)
Number to round to. If NULL
, the default,
values will be rounded to the nearest integer, unless any of the
values has non-zero fractional component (e.g. cents) and the largest
value is less than largest_with_cents
which by default is 100,000.
A scaling factor: x
will be multiplied by scale
before
formatting. This is useful if the underlying data is very small or very
large.
Symbols to display before and after value.
Character used between every 3 digits to separate thousands.
The character to be used to indicate the numeric decimal point.
Logical, if FALSE
, values are right-justified to a common
width (see base::format()
).
Other arguments passed on to base::format()
.
A numeric vector