How to format to a string to a fixed length which stores in a variable?
I have a number and I want to format to a string with zero padding and a
specific length . Suppose if the fixed length is 22 , I know I can do in
this way
format(variable,"%022d")
but does there exist any way can do by this
length = 22
format(variable,"%0lengthd")
It means I need to use variable in % variable d expression
thanks
No comments:
Post a Comment