note 111952 rejected from function.round by googleguy
| From: | googleguy@php.net | Date: | Wed, 17 Apr 2013 09:30:44 +0000 |
| Subject: | note 111952 rejected from function.round by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-194503@lists.php.net to get a copy of this message | ||
Note Submitter: goe
----
For negative values the round function seems to be broken?
I would expect that -2,5 round up to -2
what it does is it rounds down to -3.
This one works like expected
function jRound($x){
return floor($x + 0.5);
}