R/fmt.R
fmt_pct.Rd
Format percentage
fmt_pct(x, digits = 1, pre = "(", post = ")")
A numeric vector.
Number of digits.
Text before the number.
Text after the number.
A numeric vector with the expected format.
fmt_pct(c(1, 1.52, 0.3, 100)) #> [1] " (1.0)" " (1.5)" " (0.3)" "(100.0)"