From c06a7e01dea0cbaddfccad62d4d0b872d51172ab Mon Sep 17 00:00:00 2001 From: KS Date: Thu, 13 Aug 2015 14:45:06 +0200 Subject: [PATCH] Increase precision --- src/CurrencyConverter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CurrencyConverter.php b/src/CurrencyConverter.php index a90e3be..31fdb5e 100644 --- a/src/CurrencyConverter.php +++ b/src/CurrencyConverter.php @@ -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);