note 59337 deleted from function.intval by mazzanet
| From: | mazzanet@php.net | Date: | Sun, 11 Dec 2005 06:59:09 +0000 |
| Subject: | note 59337 deleted from function.intval by mazzanet | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-99945@lists.php.net to get a copy of this message | ||
Note Submitter: frankie 'at' grimboy 'dot' co 'dot' uk
----
This may be really obvious but you can get a standard rounding system by adding 0.5 to the number
you want rounded. Like so:
<?php
intval($float+0.5);
?>
This will round to the nearest integer value.