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)
152152 */
153153 public function round ($ price )
154154 {
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+ );
163159 }
164160
165161 /**
@@ -171,6 +167,9 @@ public function round($price)
171167 */
172168 public function roundPrice ($ price , $ precision = self ::DEFAULT_PRECISION )
173169 {
174- return round ((float ) $ price , $ precision );
170+ return round (
171+ floatval ((string ) $ price ), // To fix rounding error in PHP 8.4
172+ $ precision
173+ );
175174 }
176175}
You can’t perform that action at this time.
0 commit comments