Skip to content

Commit 10832bf

Browse files
authored
Merge branch '2.4.8-beta2-develop' into ACP2E-3643-1
2 parents f541315 + 276e0ac commit 10832bf

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2014 Adobe.
4+
* All rights reserved.
55
*/
66
namespace Magento\Directory\Model;
77

@@ -152,7 +152,10 @@ protected function getStore($scope = null)
152152
*/
153153
public function round($price)
154154
{
155-
return round((float) $price, 2);
155+
return round(
156+
floatval((string) $price), // To fix rounding error in PHP 8.4
157+
2
158+
);
156159
}
157160

158161
/**
@@ -164,6 +167,9 @@ public function round($price)
164167
*/
165168
public function roundPrice($price, $precision = self::DEFAULT_PRECISION)
166169
{
167-
return round((float) $price, $precision);
170+
return round(
171+
floatval((string) $price), // To fix rounding error in PHP 8.4
172+
$precision
173+
);
168174
}
169175
}

0 commit comments

Comments
 (0)