Web Hosting Talk







View Full Version : Pad 0 with perl


kapot
12-27-2003, 03:58 AM
If I have a number $n = 12345;

How can I make it as a string and padded with 0 ?

$s = "00012345";

YUPAPA
12-27-2003, 12:28 PM
$s = sprintf("%8.8d",$n);