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 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 */
66namespace 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}
You can’t perform that action at this time.
0 commit comments