Hello,
I have a table, and there is 1 column with variable length. I want to do an if condition: if the length of the values in this column is less than 10, then I want to concatenate 0s to the left of it until it reaches length 10.
For example: 666666 -> 000066666; 12345 -> 0000012345
Can I do this using a formula tool? Any sugestion?
Solved! Go to Solution.
Please use the function PADLEFT([columnname],10,"0")
Note: The column should be string datatype. To get this formula work.
Hi @cutehappybear just to slightly amend @ShankerV's suggestion - as the PadLeft() is a string function, you'll need to ensure the field is a string field
PadLeft([String],10,"0")
Or can convert it in the calc
PadLeft(ToString([num]),10,"0")
Either way the leading Zeros will need to be wrapped in quotes
Hope that helps,
Ollie