note 72186 added to function.round
| From: | christof dot moser at actra dot ch | Date: | Sat, 06 Jan 2007 13:32:51 +0000 |
| Subject: | note 72186 added to function.round | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-121351@lists.php.net to get a copy of this message | ||
<?php
function showAmount($amount, $countryData, $vat)
{
$amount = $amount*$countryData['kurs'];
if($vat == 1)
{
$amount = $amount*(100+$countryData['mwst'])/100;
}
$rval = 1/$countryData['rundung'];
$amount = (round($rval*$amount))/$rval;
return $amount;
}
$countryData['kurs'] = '1.619000';
$countryData['mwst'] = '7.60';
$countryData['rundung'] = '0.050000';
echo showAmount('3.976', $countryData, 1);
?>
----
Server IP: 194.153.94.10
Probable Submitter: 212.147.19.49
----
Manual Page -- http://www.php.net/manual/en/function.round.php
Edit -- https://master.php.net/note/edit/72186
Del: integrated -- https://master.php.net/note/delete/72186/integrated
Del: useless -- https://master.php.net/note/delete/72186/useless
Del: bad code -- https://master.php.net/note/delete/72186/bad+code
Del: spam -- https://master.php.net/note/delete/72186/spam
Del: non-english -- https://master.php.net/note/delete/72186/non-english
Del: in docs -- https://master.php.net/note/delete/72186/in+docs
Del: other reasons-- https://master.php.net/note/delete/72186
Reject -- https://master.php.net/note/reject/72186
Search -- https://master.php.net/manage/user-notes.php