prependZeros(1:10)
prependZeros(1:10, 4)
# more exotic examples
prependZeros(c(1, 100000), width = 6) ### Produces incorrect output
prependZeros.int(c(1, 100000)) ### Correct output
prependZeros(c("a", "b", "aa")) ### pads the shorter strings using zeros.
Run the code above in your browser using DataLab