Skip to content

Commit e66b9be

Browse files
committed
AC-13855: Penny rounding error in catalog rule
To fix rounding error in PHP 8.4
1 parent 58c376d commit e66b9be

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,10 @@ protected function getStore($scope = null)
153153
public function round($price)
154154
{
155155
// To fix rounding error in PHP 8.4
156-
return round(round((float) $price, 3), 2);
156+
if (str_contains(PHP_VERSION, '8.4')) {
157+
return round(round((float) $price, 3), 2);
158+
}
159+
return round((float) $price, 2);
157160
}
158161

159162
/**

0 commit comments

Comments
 (0)