Re: how to get defined number of digits after point of a variable

2005-10-20 Thread Franklin
Thanks you very much for your kind help! On 10/20/05, John W. Krahn <[EMAIL PROTECTED]> wrote: > Franklin wrote: > > Hi: > > Hello, > > > I am a real beginner of perl. after looking for Internet for serveral > > hours, I still can't find the answers for my problem. My question is: > > Which functi

Re: how to get defined number of digits after point of a variable

2005-10-20 Thread John W. Krahn
Franklin wrote: > Hi: Hello, > I am a real beginner of perl. after looking for Internet for serveral > hours, I still can't find the answers for my problem. My question is: > Which function I can use to get 2 digits after point for a variable? > For example, for $j=2.56789, how can I get the very

Re: [SPAM DETECT] how to get defined number of digits after point of a variable

2005-10-20 Thread Xavier Noria
On Oct 20, 2005, at 9:07, Franklin wrote: I am a real beginner of perl. after looking for Internet for serveral hours, I still can't find the answers for my problem. My question is: Which function I can use to get 2 digits after point for a variable? For example, for $j=2.56789, how can I get th

Re: Re: how to get defined number of digits after point of a variable

2005-10-20 Thread Beau E. Cox
Hi Wijaya Edward - At 2005-10-19, 21:18:16 you wrote: > >> Hi: > >Hi >> For example, for $j=2.56789, how can I get the very first two digits >> after points,ie, I just want to get 2.56. >> Thank you very much in advance. >> > >Is this what you want? > >$ perl -e '$j = 2.56789; $j =~ /(\d\.\d\d)

Re: how to get defined number of digits after point of a variable

2005-10-20 Thread Wijaya Edward
> Hi: Hi > For example, for $j=2.56789, how can I get the very first two digits > after points,ie, I just want to get 2.56. > Thank you very much in advance. > Is this what you want? $ perl -e '$j = 2.56789; $j =~ /(\d\.\d\d)+/; $ns = $1; print "$ns\n";' prints: 2.56 Read: perldoc perlretut.

how to get defined number of digits after point of a variable

2005-10-20 Thread Franklin
Hi: I am a real beginner of perl. after looking for Internet for serveral hours, I still can't find the answers for my problem. My question is: Which function I can use to get 2 digits after point for a variable? For example, for $j=2.56789, how can I get the very first two digits after points,ie,