What he wanted was 2 decimal points and chop everything else

Eg. 123.4567890

  Needed = 123.45 or 46 (rounding after 2 digits)

He replied to me with clarification and i think forgot to hit reply all
which brought all this confusion..

I think the problem is solved with sprintf

Urmil



-----Original Message-----
From: John W. Krahn [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 23, 2002 5:10 PM
To: [EMAIL PROTECTED]
Subject: Re: chop ing


Jeff 'Japhy' Pinyan wrote:
> 
> On May 23, John W. Krahn said:
> 
> >> while ($chopped_char ne "."){
> >>          chop $netout_new;
> >>          $chopped_char = "how do i get this???"
> >> }
> >
> >$netout_new =~ s/(?<=\.)\d+$//;
> 
> Check your logic -- the OP wants to remove "." as well:
> 
>   s/\.\d+$//;

That is not how I read it.  From the OPs original message:

Mat Harris wrote:
> 
> i know that chop returns the char chopped but how do i get that into a
var?
> i want to be able to chop all numbers after decimal point from a numeric
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> string. i thought something like this would work:
> 
> while ($chopped_char ne "."){
         ^^^^^^^^^^^^^^^^^^^^
>          chop $netout_new;
>          $chopped_char = "how do i get this???"
> }


YMMV  HAND  :-)

John
-- 
use Perl;
program
fulfillment

-- 
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