Skip to content

Commit fc48d16

Browse files
committed
AC-9221::SubTotal Rounding Issue For Decimal Quantity Enabled Product
1 parent 849003a commit fc48d16

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

app/code/Magento/Directory/Model/Currency.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,6 @@ public function formatPrecision(
344344
if (!isset($options['precision'])) {
345345
$options['precision'] = $precision;
346346
}
347-
if (is_numeric($price)) {
348-
$price = round($price, $precision);
349-
}
350347
if ($includeContainer) {
351348
return '<span class="price">' . ($addBrackets ? '[' : '') . $this->formatTxt(
352349
$price,
@@ -431,6 +428,11 @@ private function formatCurrency(string $price, array $options): string
431428

432429
$this->numberFormatter = $this->getNumberFormatter($options);
433430

431+
$this->numberFormatter->setAttribute(
432+
\NumberFormatter::ROUNDING_MODE,
433+
\NumberFormatter::ROUND_HALFUP
434+
);
435+
434436
$formattedCurrency = $this->numberFormatter->formatCurrency(
435437
$price,
436438
$this->getCode() ?? $this->numberFormatter->getTextAttribute(\NumberFormatter::CURRENCY_CODE)

0 commit comments

Comments
 (0)