Alexander Else wrote:
> 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);
Another way to round something off as per your example above, is to add
0.5 then floor
ie: $data = floor($data + 0.5)
ceil($data - 0.5) would also do
Matthew
--
SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
To unsubscribe send email to [EMAIL PROTECTED] with
unsubscribe in the text