View source: R/06_formattingFigures.R
makePct | R Documentation |
Make a nice-looking percentage out of a share.
makePct(x, digits = 0, percSymbol = TRUE, keepTrailing0 = TRUE)
x |
numeric: a share |
digits |
integer: number of decimal places for the percentage |
percSymbol |
logical: return the "%" symbol? |
keepTrailing0 |
logical: keep trailing zeros (decimals) to have the same length for all numbers? |
Character
makePct(0.25)
makePct(1.251, percSymbol = FALSE)
makePct(0.005, digits = 2)
makePct(0.26, digits = 2, keepTrailing0 = FALSE)
makePct(0.26, digits = 2, keepTrailing0 = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.