Skip to content

Commit 97fda5e

Browse files
committed
Merge remote-tracking branch 'adobe-commerce-tier-4/ACP2E-3938' into PR_2025_06_12_muntianu
2 parents f1c7064 + 3f89f2f commit 97fda5e

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2011 Adobe
4+
* All Rights Reserved.
55
*/
66

77
namespace Magento\Directory\Model;
@@ -438,10 +438,6 @@ private function formatCurrency(string $price, array $options): string
438438
$this->getCode() ?? $this->numberFormatter->getTextAttribute(\NumberFormatter::CURRENCY_CODE)
439439
);
440440

441-
if ((array_key_exists(LocaleCurrency::CURRENCY_OPTION_DISPLAY, $options)
442-
&& $options[LocaleCurrency::CURRENCY_OPTION_DISPLAY] === \Magento\Framework\Currency::NO_SYMBOL)) {
443-
$formattedCurrency = str_replace(' ', '', $formattedCurrency);
444-
}
445441
if (preg_match('/^(\x{200F})/u', $formattedCurrency, $match)) {
446442
$formattedCurrency = preg_replace('/^' . $match[1] . '/u', '', $formattedCurrency);
447443
}
@@ -488,6 +484,8 @@ private function setOptions(array $options): void
488484
if (array_key_exists(LocaleCurrency::CURRENCY_OPTION_DISPLAY, $options)
489485
&& $options[LocaleCurrency::CURRENCY_OPTION_DISPLAY] === \Magento\Framework\Currency::NO_SYMBOL) {
490486
$this->numberFormatter->setSymbol(\NumberFormatter::CURRENCY_SYMBOL, '');
487+
$this->numberFormatter->setTextAttribute(\NumberFormatter::POSITIVE_PREFIX, '');
488+
$this->numberFormatter->setTextAttribute(\NumberFormatter::POSITIVE_SUFFIX, '');
491489
}
492490
if (array_key_exists('precision', $options)) {
493491
$this->numberFormatter->setAttribute(\NumberFormatter::FRACTION_DIGITS, $options['precision']);

app/code/Magento/Directory/Test/Unit/Model/CurrencyTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2015 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

@@ -241,6 +241,8 @@ public static function getFormatTxtNumberFormatterDataProvider(): array
241241
['precision' => 2, 'symbol' => '#', 'display' => CurrencyData::NO_SYMBOL],
242242
'9,999.99'
243243
],
244+
['he_IL', 'USD', '9999', [], '9,999.00 ‏$'],
245+
['he_IL', 'USD', '9999', ['display' => CurrencyData::NO_SYMBOL], '9,999.00'],
244246
];
245247
}
246248

0 commit comments

Comments
 (0)