At 03:04 PM 4/5/00 +1000, [EMAIL PROTECTED] wrote:
>     chop;

it's a good idea to use chomp to remove trailing linebreaks, rather than 
chop (which will take out anything).


>My question is, how can I implement some code into the above, so that when 
>the
>two print statements run, it rounds up any such 100.5,10.6 code to normal
>101,11.

int, floor and ceil are your friends.  int simply lops off anything after 
the decimal point, floor rounds down, ceil rounds up.  if you wish to 
intelligently round (ie. 3.7 becomes 4, 3.2 becomes 3) then something like 
$var=sprintf("%.0f", $var); is what you want.

in the code you sent you could just do printf ("%.0f\n%.0\n", $data1, $data2);


Alexander Else
http://cyberchrist.org

--
SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
To unsubscribe send email to [EMAIL PROTECTED] with
unsubscribe in the text

Reply via email to