Skip to content

Commit c26719d

Browse files
jayankaghoshShikha Mishra
authored and
Shikha Mishra
committed
round the total amount only if it is float
1 parent 3ecdb4f commit c26719d

File tree

1 file changed

+1
-1
lines changed
  • app/code/Magento/Quote/Model/Quote/Address

1 file changed

+1
-1
lines changed

app/code/Magento/Quote/Model/Quote/Address/Total.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function __construct(
5555
public function setTotalAmount($code, $amount)
5656
{
5757
/* (Fixes issue #18027) Round the total amount to 4 decimal places, to avoid floating point overflows */
58-
$amount = number_format($amount, 4);
58+
$amount = is_float($amount) ? number_format($amount, 4) : $amount;
5959

6060
$this->totalAmounts[$code] = $amount;
6161
if ($code != 'subtotal') {

0 commit comments

Comments
 (0)