in reply to Adding Leading Zeros
my $short_num = 20188;
my $len = 10;
my $padded_num = sprintf ("%0${len}d", $short_num );
print $padded_num
prints:0000020188
Of course, there is no way to make an 11 digit number's length will not be greater than 10. ;)
|
|---|