How about
my $formatted = sprintf("%05d", $number);
-Original Message-
From: SilverFox [mailto:[EMAIL PROTECTED]
Sent: Monday, November 10, 2003 1:14 PM
To: [EMAIL PROTECTED]
Subject: Playing with Numbers
Hi all, i'm trying to figure out how to test if a number is
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 d
On Monday, Nov 10, 2003, at 13:13 US/Pacific, 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?
Examples:
444 = 00444
4120 = 04120
23 = 00023
there are two parts to your question, the la
my $integer = 432;
my $string = sprintf("%05d", $integer);
Yay!
J-S
-Message d'origine-
De: SilverFox [mailto:[EMAIL PROTECTED]
Date: 10 novembre, 2003 16:14
À: [EMAIL PROTECTED]
Objet: Playing with Numbers
Hi all, i'm trying to figure out how to test if a numbe
> -Original Message-
> From: SilverFox [mailto:[EMAIL PROTECTED]
> Sent: Monday, November 10, 2003 1:14 PM
> To: [EMAIL PROTECTED]
> Subject: Playing with Numbers
>
>
> Hi all, i'm trying to figure out how to test if a number is
> five digits and
> if
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?
Examples:
444 = 00444
4120 = 04120
23 = 00023
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]