RE: formating variables again...

2001-10-02 Thread Bob Showalter
> -Original Message- > From: Wagner Garcia Campagner [mailto:[EMAIL PROTECTED]] > Sent: Monday, October 01, 2001 5:13 AM > To: [EMAIL PROTECTED] > Subject: formating variables again... > > > Hi, > > I have a variable $var = 34.5678 > > If I > > printf ("%.2f", $var); > > Then $var =

Re: formating variables again...

2001-10-02 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Wagner Garcia Campagner) wrote: > Is there a way for me to format $var to became 34,56 instead of 34.56 ??? change the decimal point to a comma. $var =~ s/\./,/; -- brian d foy <[EMAIL PROTECTED]> - Perl services for hire CGI Meta FAQ - h

Re: formating variables again...

2001-10-01 Thread Rajeev Rumale
I would have done it like this. $var = 34.5678; $var=~/((\d+).(\d{0,2}))/; $var = $1; $var=~s/\./,/sg; printf (" The formated value is : $var"); ---OUTPUT The formated value is : 34.56 Well there may be better and more straigth forward ways, I was just trying to get used to Patterns and s