R/round0.R

Defines functions round0

Documented in round0

#' Return rounded number as string including trailing zeros
#'
#' @param x number to round
#' @param y number of decimals
#' 
#'
#' @return Rounded number
#'
#' @examples
#' 
#'
#' @export
round0 <- 
  function(x, decimals) {
    
  sprintf(paste0("%.", decimals,"f"),round(x,decimals))
    
  }
ktbaek/krisr documentation built on Feb. 21, 2022, 12:07 a.m.