note 59890 added to function.round
| From: | adrenalin at bmxstyle dot com | Date: | Mon, 19 Dec 2005 13:42:08 +0000 |
| Subject: | note 59890 added to function.round | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-100412@lists.php.net to get a copy of this message | ||
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.
----
Manual Page -- http://www.php.net/manual/en/function.round.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+59890
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+59890&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+59890&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+59890&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+59890&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+59890&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+59890&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+59890&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+59890&report=yes
Search -- http://master.php.net/manage/user-notes.php