RE: Formatting Variables

2005-10-12 Thread Ryan Frantz
> -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, > > > >

Re: Formatting Variables

2005-10-12 Thread Wiggins d'Anconia
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

Formatting Variables

2005-10-12 Thread Ryan Frantz
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

Re: Formatting Variables.

2003-02-11 Thread Janek Schleicher
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

RE: Formatting Variables.

2003-02-11 Thread Westgate, Jared
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

RE: Formatting Variables.

2003-02-11 Thread Ramón Chávez
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

RE: Formatting Variables.

2003-02-11 Thread wiggins
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

RE: Formatting Variables.

2003-02-11 Thread Ken Lehman
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

Formatting Variables.

2003-02-11 Thread Ramón Chávez
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