On Mon, 10 Nov 2003 16:13:43 -0500, SilverFox wrote:
> Hi all, i'm trying to figure out how to test if a number is five digits
> and if not add zero/s in front to make it 5 digits. Any ideas?????

You don't necessarily need to test if a number is x digits.  You purely
tell Perl to treat it like x digits what-so-ever;

  $number = sprintf("%05d", $number);

Hence, you might want to check if the number really _is_ a number, and
that's a whole other story alltogether. :-)


-- 
Tore Aursand <[EMAIL PROTECTED]>


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

Reply via email to