f_dollar {numform} | R Documentation |
f_dollar
- A wrapper for f_num
that formats
dollar values as labeled dollars.
f_dollar(x, leading_zero = TRUE, digits = 2, p = "$", ...)
ff_dollar(...)
x |
A vector of values. |
leading_zero |
logical. If |
digits |
The number of digits to use. Defaults to 2. Can be set
globally via: |
p |
A string to paste at the beginning of the output from |
... |
Other values passed to |
Returns a string of publication ready digits.
f_dollar(c(30, 33.45, .1))
## Not run:
library(dplyr)
f_dollar(c(0.0, 0, .2, -00.02, 1122222, pi)) %>% f_comma()
## End(Not run)