Re: Looking for something like floor() only to round to a nearest div
| From: | cybot | Date: | Tue, 28 Jan 2003 20:03:13 +0000 |
| Subject: | Re: Looking for something like floor() only to round to a nearest div | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-18149@lists.php.net to get a copy of this message | ||
just use
$floor_val = 6 * ((int) 15/6)
John Asendorf wrote:
I'm looking for a function like floor() only I want it rounded to a number that is divisible by another number. For instance, if the divisor is 6, alt_floor ( 15 , 6 ) would yield 12 where 15 is the input and 6 is the divisor. Or, alt_floor ( 174 , 20 ) would yield 160... Anyone already do something like this? Thanks, John --------------------- John Asendorf - jasendorf@lcounty.com Web Applications Developer http://www.lcounty.com - NEW FEATURES ADDED DAILY! Licking County, Ohio, USA 740-349-3631 Nullum magnum ingenium sine mixtura dementiae fuit-- Sebastian Mendel info@sebastianmendel.de www.sebastianmendel.de www.tekkno4u.de www.nofetish.com