note 59890 deleted from function.round by danbrown
| From: | danbrown@php.net | Date: | Sun, 17 May 2009 16:22:33 +0000 |
| Subject: | note 59890 deleted from function.round by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-154809@lists.php.net to get a copy of this message | ||
Note Submitter: adrenalin at bmxstyle dot com
----
Oh sorry, I had mistake in a simple version of the script. Here is a working and tested version:
<?php
function divby($val, $by) {
$val -= $val % $by;
return $val;
}
?>
But in blackhole's description is a little mistake, because if I try: divby(-23, 10); it will
return -20, because $val is negative so the result must be negative too.