Question : perl leading zeros formatting sprintf
Answered by : vternal3
# Format number with up to 8 leading zeroes
my $result = sprintf("%08d", $number);
# Round number to 3 digits after decimal point
my $rounded = sprintf("%.3f", $number);
Source : https://perldoc.perl.org/functions/sprintf | Last Update : Sun, 17 Oct 21