comma | R Documentation |
This function is useful if used in Rmarkdown documents or when used to print nice tables.
comma(x, digits = 1, trailing = FALSE)
x |
A numeric object to modify |
digits |
Desired number of digits after the decimal point |
trailing |
Should trailing zeroes be preserved? Default = FALSE |
A properly formatted character object
x <- 200.00 comma(x, digits = 1) # "200" comma(x, digits = 1, trailing = TRUE) # "200.0"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.