note 89341 deleted from function.round by danbrown
| From: | danbrown@php.net | Date: | Wed, 04 Mar 2009 16:28:21 +0000 |
| Subject: | note 89341 deleted from function.round by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-151465@lists.php.net to get a copy of this message | ||
Note Submitter: elar at trigger dot ee
----
<?php
$no1 = 930;
$no2 = 18.6;
$result = $no1 / $no2;
var_dump($result); // float(50)
// float(50) seems correct, BUT!
var_dump(floor($result)); // float(49)
// solution for me is
var_dump(floor(round($result, 14))); // float(50)
// but
var_dump(floor(round($result, 15))); // float(49)
?>