|
1 | 1 | <?php
|
2 | 2 | /**
|
3 |
| - * Copyright © Magento, Inc. All rights reserved. |
4 |
| - * See COPYING.txt for license details. |
| 3 | + * Copyright 2011 Adobe |
| 4 | + * All Rights Reserved. |
5 | 5 | */
|
6 | 6 |
|
7 | 7 | namespace Magento\Directory\Model;
|
@@ -438,10 +438,6 @@ private function formatCurrency(string $price, array $options): string
|
438 | 438 | $this->getCode() ?? $this->numberFormatter->getTextAttribute(\NumberFormatter::CURRENCY_CODE)
|
439 | 439 | );
|
440 | 440 |
|
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 |
| - } |
445 | 441 | if (preg_match('/^(\x{200F})/u', $formattedCurrency, $match)) {
|
446 | 442 | $formattedCurrency = preg_replace('/^' . $match[1] . '/u', '', $formattedCurrency);
|
447 | 443 | }
|
@@ -488,6 +484,8 @@ private function setOptions(array $options): void
|
488 | 484 | if (array_key_exists(LocaleCurrency::CURRENCY_OPTION_DISPLAY, $options)
|
489 | 485 | && $options[LocaleCurrency::CURRENCY_OPTION_DISPLAY] === \Magento\Framework\Currency::NO_SYMBOL) {
|
490 | 486 | $this->numberFormatter->setSymbol(\NumberFormatter::CURRENCY_SYMBOL, '');
|
| 487 | + $this->numberFormatter->setTextAttribute(\NumberFormatter::POSITIVE_PREFIX, ''); |
| 488 | + $this->numberFormatter->setTextAttribute(\NumberFormatter::POSITIVE_SUFFIX, ''); |
491 | 489 | }
|
492 | 490 | if (array_key_exists('precision', $options)) {
|
493 | 491 | $this->numberFormatter->setAttribute(\NumberFormatter::FRACTION_DIGITS, $options['precision']);
|
|
0 commit comments