File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
app/code/Magento/Directory/Model Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
2
/**
3
- * Copyright © Magento, Inc. All rights reserved .
4
- * See COPYING.txt for license details .
3
+ * Copyright 2014 Adobe .
4
+ * All rights reserved .
5
5
*/
6
6
namespace Magento \Directory \Model ;
7
7
@@ -152,7 +152,10 @@ protected function getStore($scope = null)
152
152
*/
153
153
public function round ($ price )
154
154
{
155
- return round ((float ) $ price , 2 );
155
+ return round (
156
+ floatval ((string ) $ price ), // To fix rounding error in PHP 8.4
157
+ 2
158
+ );
156
159
}
157
160
158
161
/**
@@ -164,6 +167,9 @@ public function round($price)
164
167
*/
165
168
public function roundPrice ($ price , $ precision = self ::DEFAULT_PRECISION )
166
169
{
167
- return round ((float ) $ price , $ precision );
170
+ return round (
171
+ floatval ((string ) $ price ), // To fix rounding error in PHP 8.4
172
+ $ precision
173
+ );
168
174
}
169
175
}
You can’t perform that action at this time.
0 commit comments