ec_leading_zeros the_integer n_desired_digits
Adds leading zeros to an integer to give it the desired number of digits
Source code:
return [format "%0${n_desired_digits}d" $the_integer]