Skip to content

Commit ff02782

Browse files
committed
fix: rounding
1 parent c3e3deb commit ff02782

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

lib/Service/FetchCurrenciesService.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,7 @@ class FetchCurrenciesService {
3131
private LoggerInterface $logger;
3232

3333
/**
34-
* @var array<string, array{
35-
* symbol: string,
36-
* name: string,
37-
* symbol_native: string,
38-
* decimal_digits: int,
39-
* rounding: int,
40-
* code: string,
41-
* name_plural: string
42-
* }>
34+
* @var array<string, mixed>
4335
*/
4436
public array $symbols;
4537

@@ -99,7 +91,7 @@ public function fetchCurrencyRates(): void {
9991
}
10092
$lcur = strtolower($cur);
10193
$baseRate = $json[$lbase][$lcur];
102-
$newRate = floatval(number_format(1 / $baseRate, 2));
94+
$newRate = 1.0 / $baseRate;
10395
$currency->setExchangeRate($newRate);
10496
$this->logger->info('Setting exchange rate for currency ' . $cur . ' to ' . $newRate);
10597
$this->currencyMapper->update($currency);

0 commit comments

Comments
 (0)