prefix integers with leading zeros
padInteger(x, padCharacter = "0", useNchar = NULL, ...)
integer
, numeric
, or character
vector. In reality, only
nchar(x)
is required to determine padding.
character
with nchar(padCharacter)==1, used to pad
each digit as a prefix.
NULL
or integer
number of digits used, or if the maximum
nchar(x)
is higher, that number of digits is used. Note useNchar
is
mostly useful when all numbers are less than 10, but the desired output
is to have a fixed number of digits 2 or higher.
additional parameters are ignored.
character
vector of length(x).
The purpose of this function is to pad integer numbers so they contain a consistent number of digits, which is helpful when sorting values as character strings.
Other jam string functions:
asSize()
,
breaksByVector()
,
cPasteSU()
,
cPasteS()
,
cPasteUnique()
,
cPasteU()
,
cPaste()
,
fillBlanks()
,
formatInt()
,
gsubOrdered()
,
gsubs()
,
makeNames()
,
mixedOrder()
,
mixedSortDF()
,
mixedSorts()
,
mixedSort()
,
mmixedOrder()
,
nameVectorN()
,
nameVector()
,
padString()
,
pasteByRowOrdered()
,
pasteByRow()
,
sizeAsNum()
,
tcount()
,
ucfirst()
,
uniques()