On Fri, 12 Oct 2001, Chuck wrote:
> It is now printing the number as a negative:
> print "\n";
> printf "%15d bytes free in $phost:/var/tmp\n", $freespace;
>
> Result:
> -48288 bytes free in smh4:/var/tmp
Your integer is too big to be handled as an integer. :-) Use %15.f for
your format
On Fri, 12 Oct 2001, Chuck wrote:
> Oh my god. *BONK*'
>
> You are correct, this is no doubt the dumbest mistake I have ever made.
Bah, we've all been there. It's one of the best ways to learn: "That
which does not kill us makes us stronger." :-)
-- Brett
;[EMAIL PROTECTED]>
To: "'Brett W. McCoy'" <[EMAIL PROTECTED]>; "Chuck"
<[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, October 12, 2001 9:54 AM
Subject: RE: Format interger printing, MORE INFO
> > -Original Message-
>
PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, October 12, 2001 9:54 AM
Subject: RE: Format interger printing, MORE INFO
> > -Original Message-
> > From: Brett W. McCoy [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, October 12, 2001 12:17 AM
> > To: Chu
I get the formatting
correct)
Any ideas??
thankx.,
CC
- Original Message -
From: "Vinicius Jose Latorre" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, October 11, 2001 5:42 PM
Subject: Re: Format interger printing
>
> -Original Message-
> From: Brett W. McCoy [mailto:[EMAIL PROTECTED]]
> Sent: Friday, October 12, 2001 12:17 AM
> To: Chuck
> Cc: Vinicius Jose Latorre; [EMAIL PROTECTED]
> Subject: Re: Format interger printing, MORE INFO
>
>
> On Thu, 11 Oct 2001, Chuck wrot
On Thu, 11 Oct 2001, Chuck wrote:
> Here is a snippet:
> printf "%20d bytes free in $phost:/var/tmp\n", $freespace;
> printf "$shipsize bytes being shipped.\n";
>
> Here is the output:
> -1012379648 bytes free in smh4:/var/tmp
> 359731200 bytes being shipped.
It's because 3282567168, apparently,
On Thu, 11 Oct 2001, Chuck wrote:
> Nothing is working, I have tried every permutation.
I tried this right on the command line:
$ perl -e 'printf "%10d\n", 25'
25
-- Brett
http://www.chapelperilous.net/
-
On Thu, 11 Oct 2001, Chuck 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;
Remove the -
printf "%10d", $x;
Works for me.
-- Brett
http://www.chapel
ot;, $freespace;
> printf "$shipsize bytes being shipped.\n";
>
> Here is the output:
> -1012379648 bytes free in smh4:/var/tmp
> 359731200 bytes being shipped.
>
> ???
>
> CC
>
>
> - Original Message -
> From: "Vinicius Jose Lat
ot;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 byt
ot;$shipsize bytes being shipped.\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]>
S
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 be
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.
>
>
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 jus
15 matches
Mail list logo