in reply to Re^2: Removing Commas and Period in Amount Field
in thread Removing Commas and Period in Amount Field

Maybe this is what you're looking for:
# left-pad with zeros, total length of 21 my $checknum = sprintf("%021d", $source);

See sprintf.