Convert numeric to character with padding

paddedFloatToChar(x, padL = ceiling(log10(x + 1)), padR = 3, pad = "0")

Arguments

x

numeric. Number to be converted to character with padding

padL

numeric. Desired number of digits on left side of decimal. If not enough, pad will be used to pad.

padR

numeric. Desired number of digits on right side of decimal. If not enough, pad will be used to pad.

pad

character to use as padding (nchar(pad)==1 must be TRUE). Passed to stri_pad

Value

Character string representing the filename.

Examples

# NOT RUN {
paddedFloatToChar(1.25)
paddedFloatToChar(1.25, padL = 3, padR = 5)

# }