R/zerofill.R

Defines functions zerofill

Documented in zerofill

#' Fill with left zeros 
#' @param int integer
#' @param n int length of character  
#' @return character of length \code{n} filled with 0 on the left

zerofill <- function(int, nceros){
  resultado <- gettextf(paste("%0",nceros,"i", sep = ''), as.numeric(int));
  return(resultado);
}
diegogarcilazo/myutilities documentation built on Jan. 4, 2024, 2:11 p.m.