money icon indicating copy to clipboard operation
money copied to clipboard

roundToUnit ignores ROUND_UP

Open arokettu opened this issue 3 years ago • 0 comments

$f = new \Money\Formatter\DecimalMoneyFormatter(new \Money\Currencies\ISOCurrencies());
$sum = \Money\Money::EUR('1234');
echo $f->format($sum->roundToUnit(2, \Money\Money::ROUND_UP));

expected: 13.00 actual: 12.00

Likely the method should use $this->round instead of self::$calculator::round

arokettu avatar Sep 08 '22 23:09 arokettu