PM
To: beginners@perl.org
Subject: Re: Equal length ID numbers
Yeps, use the printf function, something like this:
$ perl -e 'printf("%04d\n", 1);'
0001
JeeBee.
On Thu, 15 Dec 2005 14:42:46 +0100, Andrej Kastrin wrote:
> Hi all,
>
> Suppose that we have numbers 1 to 100
Yeps, use the printf function, something like this:
$ perl -e 'printf("%04d\n", 1);'
0001
JeeBee.
On Thu, 15 Dec 2005 14:42:46 +0100, Andrej Kastrin wrote:
> Hi all,
>
> Suppose that we have numbers 1 to 1000 and we want all numbers be equal
> lengh; e.g.:
> 0001
> 0002
> 0003
> ...
> ..
> 100
Andrej Kastrin wrote:
> Hi all,
>
> Suppose that we have numbers 1 to 1000 and we want all numbers be
> equal lengh; e.g.:
> 0001
> 0002
> 0003
> ...
> ..
> 1000
>
> Any ideaa on how to fix this problem?
>
> Best, Andrej
perldoc -f sprintf
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For addit