Maybe you should use Math::BigInt.

I've just tried:

   #!/usr/bin/perl -w
   use Math::BigInt;
   my $x = 25;
   printf "%-10d bytes\n", $x;
   printf "%10d bytes\n", $x;
   my $freespace = Math::BigInt->new (3282567168);
   printf "%-20s bytes\n", $freespace;
   printf "%20s bytes\n", $freespace;
   print "$freespace bytes\n";

And the result now is:

25         bytes
        25 bytes
+3282567168          bytes
         +3282567168 bytes
+3282567168 bytes


Vinicius

------ Chuck <[EMAIL PROTECTED]> wrote:
> Here is a snippet:
> printf "$freespace bytes free.<BR>\n";
> printf "$shipsize bytes being shipped.<P>\n";
> 
> Here is the output:
> 3282567168 bytes free.
> 359731200 bytes being shipped.
> 
> Here is a snippet:
> printf "%20d bytes free in $phost:/var/tmp<BR>\n", $freespace;
> printf "$shipsize bytes being shipped.<P>\n";
> 
> Here is the output:
> -1012379648 bytes free in smh4:/var/tmp
> 359731200 bytes being shipped.
> 
> ???
> 
> CC
> 
> 
> ----- Original Message -----
> From: "Vinicius Jose Latorre" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Thursday, October 11, 2001 4:08 PM
> Subject: Re: Format interger printing
> 
> 
> >
> > Try:
> >
> >    printf "%10d bytes", $x;
> >
> >
> > Vinicius
> >
> > ------ Chuck <[EMAIL PROTECTED]> wrote:
> > > Arg, I am going crazy. Ok, it has been a long time since I was kneee
> deep in
> > > perl, but why does this not work:
> > >
> > >
> > > printf "%-10d bytes", $x;
> > >
> > > It does not pad the output with spaces or anything.
> > >
> > > if x = 25
> > >
> > > this is the result:
> > >
> > > 25 bytes
> > >
> > > I want it tobe:
> > >
> > >   25 bytes
> > >
> > > Anyone have any ideas. I just scanned thourgh both Programming Perl and
> the
> > > Cookbook and could not find this.
> > >
> > > Thankx,
> > > CC

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

Reply via email to