RE: chop ing not phrased correctly

2002-05-23 Thread Mat Harris
At 17:24 23/05/2002 -0500, Shah, Urmil wrote: >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 t

RE: chop ing not phrased correctly

2002-05-23 Thread Shah, 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 ".&

Re: chop ing

2002-05-23 Thread John W. Krahn
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: > >

Re: chop ing

2002-05-23 Thread Jeff 'japhy' Pinyan
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+$//; -- Jeff "japhy" Pinyan [EMAIL PRO

Re: chop ing

2002-05-23 Thread John W. Krahn
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; >

RE: chop ing

2002-05-23 Thread Shah, Urmil
$netout_new=~/(\d+)\.(\d+)/; $integer=$1; $decimal=$2; print" Integer=$integer and dec=$decimal\n"; See if this helps Urmil -Original Message- From: Mat Harris [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 23, 2002 3:53 PM To: [EMAIL PROTECTED] Subject: chop ing i know

RE: chop ing

2002-05-23 Thread Nikola Janceski
that will work. but shouldn't you be using sprintf() for this? > -Original Message- > From: Shishir K. Singh [mailto:[EMAIL PROTECTED]] > Sent: Thursday, May 23, 2002 4:55 PM > To: Mat Harris; [EMAIL PROTECTED] > Subject: RE: chop ing > > > does > &g

RE: chop ing

2002-05-23 Thread Shishir K. Singh
does $chopped_char = chop $netout_new; work ?? -Original Message- From: Mat Harris [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 23, 2002 4:53 PM To: [EMAIL PROTECTED] Subject: chop ing i know that chop returns the char chopped but how do i get that into a var? i want to be able

chop ing

2002-05-23 Thread Mat Harris
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