Quoting from page 122 of O'Reillys "Programming Perl," which, by the way, is
a most excellent book:
    Quote: "As an alternate form of right justification, you may also use #
characters (after an initial @ or ^, and with an optional ".") to specify a
numeric field. This way you can line up the decimal points."  Unquote


----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, September 06, 2001 9:43 AM
Subject: RE: Printf


> You could try something like this:
>
> #######################
> use strict
>
> @a = qw(10.000 100.00 1000000.00000 1000.000);
> $a = $b = "";
>
> foreach $val (@a) {
>   ($a,$b) = split(/\./,$val);
>   write;
> }
>
> format STDOUT =
> @>>>>>>>>>.@<<<<<<<<<
> $a,$b
> .
> #######################
>
>
>
>
> > -----Original Message-----
> > From: Govinderjit Dhinsa [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, September 06, 2001 9:38 AM
> > To: '[EMAIL PROTECTED]'
> > Cc: '[EMAIL PROTECTED]'
> > Subject: Printf
> >
> >
> > How could I please put the following example;
> >
> > 1000.000
> > 10.0000000
> > 100.0000000
> > 10000.0000000
> > To please print out, IN A LINE with the Decimal Place! and
> > not from the
> > first number, so all the decimal places would line up!
> > example;
> >
> > I have tried printf and had no luck
> >
> > Thanks
> > GD
> >
> >
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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

Reply via email to