Hi Monks, I have the doubt in sprintf.
I need to fill the leading zeros for my given no of digit.
I have tried the following but not getting the correct result.
Do u have these problem in previous?. please suggest me to solve the problem.
$dig=4; $inc=5; $res=sprintf("%0$digd", $inc); print $res; #output should be #0005
In reply to sprintf formatting doubt by perlsen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |