note 72186 deleted from function.round by danbrown

From: Date: Sun, 17 May 2009 16:19:06 +0000
Subject: note 72186 deleted from function.round by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-154796@lists.php.net to get a copy of this message
Note Submitter: christof dot moser at actra dot ch ---- <?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); ?>

« previous php.notes (#154796) next »