31 \
Magento\Framework\
App\ScopeResolverInterface $scopeResolver,
35 $this->_scopeResolver = $scopeResolver;
36 $this->_localeResolver = $localeResolver;
70 $separatorComa = strpos(
$value,
',');
71 $separatorDot = strpos(
$value,
'.');
73 if ($separatorComa !==
false && $separatorDot !==
false) {
74 if ($separatorComa > $separatorDot) {
79 }
elseif ($separatorComa !==
false) {
95 $localeCode = $localeCode ?: $this->_localeResolver->getLocale();
97 $currency = $this->currencyFactory->create()->load($currencyCode);
99 $currency = $this->_scopeResolver->getScope()->getCurrentCurrency();
102 $formatter = new \NumberFormatter(
103 $localeCode .
'@currency=' . $currency->getCode(),
104 \NumberFormatter::CURRENCY
106 $format = $formatter->getPattern();
107 $decimalSymbol = $formatter->getSymbol(\NumberFormatter::DECIMAL_SEPARATOR_SYMBOL);
108 $groupSymbol = $formatter->getSymbol(\NumberFormatter::GROUPING_SEPARATOR_SYMBOL);
111 if (
$pos !==
false) {
116 $decimalPoint = strpos(
$format,
'.');
117 if ($decimalPoint !==
false) {
120 $decimalPoint = strlen(
$format);
122 $requiredPrecision = $totalPrecision;
123 $t = substr(
$format, $decimalPoint);
124 $pos = strpos($t,
'#');
125 if (
$pos !==
false) {
126 $requiredPrecision = strlen($t) -
$pos - $totalPrecision;
129 if (strrpos(
$format,
',') !==
false) {
137 'pattern' => $currency->getOutputFormat(),
138 'precision' => $totalPrecision,
139 'requiredPrecision' => $requiredPrecision,
140 'decimalSymbol' => $decimalSymbol,
141 'groupSymbol' => $groupSymbol,
143 'integerRequired' => $totalPrecision == 0,
elseif(isset( $params[ 'redirect_parent']))