Rounding arithmetic results
| From: | Dion Vansevenant | Date: | Wed, 14 Jun 2000 19:32:28 +0000 |
| Subject: | Rounding arithmetic results | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-1860@lists.php.net to get a copy of this message | ||
I am fairly new to PHP3 so please forgive me if this seems like to
no-brainer to you.
I am working on a little chunk of code that counts the number of pages in a
given area, then divides by 2 to determine how many items to print in each
of two columns of a table.
Works just great when the results are based on an even number of pages, but
odd numbers give me half answers (1.5, 2.5, etc.).
What would be a good method of checking for a half answer and rounding up?
Thanks.
Dion
*************************************************************************
* Dion Vansevenant *
* Systems & Technology Analyst dion.vansevenant@rowecom.ca *
* RoweCom Canada Tel: (519) 472-1005 *
* P.O. Box 2382 Fax: (519) 472-1072 *
* London, ON N6A 5A7 www.rowecom.ca *
* Canada *
*************************************************************************