style_number | R Documentation |
Style numbers
style_number(
x,
digits = 0,
big.mark = NULL,
decimal.mark = NULL,
scale = 1,
...
)
x |
Numeric vector |
digits |
Integer or vector of integers specifying the number of decimals
to round |
big.mark |
Character used between every 3 digits to separate
hundreds/thousands/millions/etc.
Default is |
decimal.mark |
The character to be used to indicate the numeric decimal point.
Default is |
scale |
A scaling factor: x will be multiplied by scale before formatting. |
... |
Other arguments passed on to |
formatted character vector
Other style tools:
style_percent()
,
style_pvalue()
,
style_ratio()
,
style_sigfig()
c(0.111, 12.3) %>% style_number(digits = 1)
c(0.111, 12.3) %>% style_number(digits = c(1, 0))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.