6 declare(strict_types=1);
20 private $priceCurrency;
25 private $roundingDeltas;
32 $this->priceCurrency = $priceCurrency;
46 $delta = isset($this->roundingDeltas[
$type]) ? $this->roundingDeltas[
$type] : 0.000001;
48 $roundPrice = $this->priceCurrency->round(
$price);
49 $this->roundingDeltas[
$type] =
$price - $roundPrice;
63 $this->roundingDeltas = [];
74 if (isset($this->roundingDeltas[
$type])) {
75 unset($this->roundingDeltas[
$type]);
__construct(PriceCurrencyInterface $priceCurrency)
round(float $price, string $type)