#sprintf FORMAT, LIST Returns a string formatted by the usual printf conventions of the C library function sprintf. See below for more details and see sprintf(3) or printf(3) on your system for an explanation of the general principles. For example: # Format number with up to 8 leading zeroes my $result = sprintf("%08d", $number); # Round number to 3 digits after decimal point my $rounded = sprintf