note 24522 modified in function.round by danbrown
| From: | danbrown@php.net | Date: | Sun, 17 May 2009 16:26:34 +0000 |
| Subject: | note 24522 modified in function.round by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-154828@lists.php.net to get a copy of this message | ||
because of some site-effects between round() and modulo, therfore the result is not exactly at
every time ...
another way ( and without site-effects) of getting 0.05 increments for currencies, f.e. swiss
francs:
<?php
$res = (round(20*$chf))/20;
echo $res;
?>
with kind regards
--was--
because of some site-effects between round() and modulo, therfore the result is not exactly at
every time ...
another way ( and without site-effects) of getting 0.05 increments for currencies, f.e. swiss
francs:
$res = (round(20*$chf))/20;
echo $res;
with kind regards
http://php.net/manual/en/function.round.php