Skip to content

Commit c6157e6

Browse files
committed
AC-13855: Penny rounding error in catalog rule
Update rounding method
1 parent db7e632 commit c6157e6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

app/code/Magento/Directory/Model/PriceCurrency.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
*/
1616
class PriceCurrency implements \Magento\Framework\Pricing\PriceCurrencyInterface
1717
{
18-
private const PRECISION_TO_FIX_PENNY_ROUNDING_ERROR = 3;
19-
2018
/**
2119
* @var \Magento\Store\Model\StoreManagerInterface
2220
*/
@@ -154,7 +152,8 @@ protected function getStore($scope = null)
154152
*/
155153
public function round($price)
156154
{
157-
return round((float) $price, self::PRECISION_TO_FIX_PENNY_ROUNDING_ERROR);
155+
// To fix rounding error in PHP 8.4
156+
return round(round((float) $price, 3), 2);
158157
}
159158

160159
/**

0 commit comments

Comments
 (0)