File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
app/code/Magento/Directory/Model Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -152,14 +152,10 @@ protected function getStore($scope = null)
152
152
*/
153
153
public function round ($ price )
154
154
{
155
- // To fix rounding error in PHP 8.4
156
- if (version_compare (PHP_VERSION , '8.4 ' , '>= ' )) {
157
- return round (
158
- floatval ((string ) $ price ),
159
- 2
160
- );
161
- }
162
- return round ((float ) $ price , 2 );
155
+ return round (
156
+ floatval ((string ) $ price ), // To fix rounding error in PHP 8.4
157
+ 2
158
+ );
163
159
}
164
160
165
161
/**
@@ -171,6 +167,9 @@ public function round($price)
171
167
*/
172
168
public function roundPrice ($ price , $ precision = self ::DEFAULT_PRECISION )
173
169
{
174
- return round ((float ) $ price , $ precision );
170
+ return round (
171
+ floatval ((string ) $ price ), // To fix rounding error in PHP 8.4
172
+ $ precision
173
+ );
175
174
}
176
175
}
You can’t perform that action at this time.
0 commit comments