R/formatPercent.R

Defines functions formatPercent

Documented in formatPercent

#' Returns a percentage value of a decimal
#'
#' @param x the string
#' @param digits number of decimal places
#' @param ... arguments passed to format.
#' @export
#'
formatPercent <- function(x, digits = 0, ...) {
  paste0(formatC(100 * x, format = "f", digits = digits, ...), "%")
}
dr-harper/HarpR documentation built on Nov. 8, 2019, 8:56 p.m.