Dan Muey wrote:
> Howdy all,
> 
> I know I'm being a puts but I can't for the life of me get sprintf to
> do my bidding. 
> 
> What I'm tryng to do is take a number, say 5 or 10 and make them
> three digits long with Zeros on the left:
> 
> IE
> 5 would become 005
> And 10 would become 010
> 
>  my $five = 5;
>  my $ten = 10;
> 
>  $five = sprintf(???, $five);
>  $ten  = sprintf(???, $ten);
> 
>  print $five;
>  print "\n";
>  print $ten;
> 
> Should do:
> 005
> 010
> 
> Help! I'm stupid today!
> 
> TIA
> 
> Dan

        use %03d for three digits and zero fill.  Use a zero as part of the params to 
get zero fill, even on text if necessary.

Wags ;)


**********************************************************
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
****************************************************************


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to