Skip to content

Commit f3a4302

Browse files
committed
AC-13855: Penny rounding error in catalog rule
To fix rounding error in PHP 8.4
1 parent 77d1478 commit f3a4302

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ protected function getStore($scope = null)
152152
*/
153153
public function round($price)
154154
{
155+
// To fix rounding error in PHP 8.4
156+
if (str_contains(PHP_VERSION, '8.4')) {
157+
return round(round((float) $price, 3), 2);
158+
}
155159
return round((string) $price, 2);
156160
}
157161

0 commit comments

Comments
 (0)