Skip to content

Commit

Permalink
Increase precision
Browse files Browse the repository at this point in the history
  • Loading branch information
KS committed Aug 13, 2015
1 parent 504edbf commit c06a7e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/CurrencyConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function convert($fromAmount, $fromCurrency, $toCurrency, \DateTime $pubD
$toMultiplier = str_replace(',', '.', $rates['waluty'][$toCurrency]['przelicznik']);
$toAverageRate = str_replace(',', '.', $rates['waluty'][$toCurrency]['kurs_sredni']);

bcscale(6);
bcscale(20);
$plnAmount = bcdiv(bcmul($fromAmount, $fromAverageRate), $fromMultiplier);
$resultAmount = bcdiv(bcmul($plnAmount, $toMultiplier), $toAverageRate);
$roundedResult = BCMathHelper::bcround($resultAmount, 4);
Expand Down

0 comments on commit c06a7e0

Please sign in to comment.