| bcat_fmt_dollar | R Documentation |
A wrapper for scales::label_dollar to format a numeric vector to dollars and cents.
bcat_fmt_dollar(
x,
accuracy = NULL,
scale = 1,
largest_with_cents = 1e+05,
style_negative = c("hyphen", "parens"),
...
)
x |
a numeric vector |
accuracy |
Number to round to. If NULL, the default, values will be rounded to the nearest integer |
scale |
A scaling factor: |
largest_with_cents |
largest numeric value for which cents will be displayed |
style_negative |
Character. How to display negative values:
|
... |
other arguments passed on to label_dollar |
A character vector of formatted currency labels with the same length as
x.
Other formatting:
bcat_fmt_comma(),
bcat_fmt_date(),
bcat_fmt_percent(),
bcat_fmt_pvalue(),
bcat_fmt_scientific()
bcat_fmt_dollar(1:4)
bcat_fmt_dollar(c(-20, -10, 10, 20))
bcat_fmt_dollar(c(-20, -10, 10, 20), style_negative = "parens")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.