Skip to content
Snippets Groups Projects
Commit c19ded45 authored by Laura A DeCicco's avatar Laura A DeCicco
Browse files

Fixed bug if number of digits already there was greater than what was being padded to.

parent 37dd89c0
No related branches found
No related tags found
No related merge requests found
......@@ -12,7 +12,7 @@
#' correctPCode <- padVariable(pCode,5)
padVariable <- function(x,padTo){
numDigits <- nchar(x)
if (padTo != numDigits){
if ((padTo-numDigits)>0){
leadingZeros <- paste(rep("0",(padTo-numDigits)),collapse="",sep="")
x <- paste(leadingZeros,x,sep="")
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment