> -Original Message-
> From: Wiggins d'Anconia [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, October 12, 2005 5:31 PM
> To: Ryan Frantz
> Cc: Perl Beginners List
> Subject: Re: Formatting Variables
>
> Ryan Frantz wrote:
> > Perlers,
> >
> >
Ryan Frantz wrote:
> Perlers,
>
>
>
> Is there are way to format a variable before placing it into an array or
> hash? I have several variables that contain floating point numbers that
> I format prior to printing out:
>
>
>
> my $float = "12.3456";
>
> print "%2.1f\n", $float;
>
perld
Perlers,
Is there are way to format a variable before placing it into an array or
hash? I have several variables that contain floating point numbers that
I format prior to printing out:
my $float = "12.3456";
print "%2.1f\n", $float;
I'd like to place these scalars into an array for l
On Tue, 11 Feb 2003 08:06:33 -0600, Rgíón «hávkú wrote:
> Is there a way to give format to a Variable.
perldoc -f printf
> I mean, if I don't want to get printed 3.1415926535 (Or any irrational
> number) but something like 3.14, is there a way to use format??
perl -e 'printf "%1.2f", 3.14159265
Ramón Chávez wrote:
> I mean, if I don't want to get printed 3.1415926535 (Or any irrational
> number) but something like 3.14, is there a way to use format??
I agree with the other posts. Use printf. Here is some more reading, to check out:
perldoc -q "long decimals"
perldoc -q "round"
Hope t
Thank you everyone.
sprintf is what I was looking for.
-rm-
- Original Message -
From: <[EMAIL PROTECTED]>
To: 'Ramón_Chávez' <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, February 11, 2003 8:30 AM
Subject: RE: Formatting Variables.
> See a
e you tried using printf?
>
> -Original Message-
> From: Ramón Chávez [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 11, 2003 9:07 AM
> To: [EMAIL PROTECTED]
> Subject: Formatting Variables.
>
>
> Hello boys and girls.
>
> Is there a way to give format t
Have you tried using printf?
-Original Message-
From: Ramón Chávez [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 9:07 AM
To: [EMAIL PROTECTED]
Subject: Formatting Variables.
Hello boys and girls.
Is there a way to give format to a Variable.
I mean, if I don't want t
Hello boys and girls.
Is there a way to give format to a Variable.
I mean, if I don't want to get printed 3.1415926535 (Or any irrational
number) but something like 3.14, is there a way to use format??
Or I need to make some string treating (more lines)??
Thank you everyone.
-rm-
--
To unsu