R/percent2.R

Defines functions percent2

Documented in percent2

#----------------------------------------------------------------------------#
#' @title formating numbers
#' @description Return formated string of number
#' @param digit a number defining digits
#' @param x vector
#' @param ... ...
#' @export
percent2 = function(x,digit=2,...) {
  n = paste0("%.",digit,"f%%")
  sprintf(n,x*100)
}
hdeng88/publishr documentation built on Aug. 30, 2023, 1 p.m.