Skip to content

Commit 96c9fe3

Browse files
committed
MAGETWO-35361: Price is displayed without decimal part on a product page
1 parent 8e30a58 commit 96c9fe3

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

lib/internal/Magento/Framework/Locale/Format.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,13 @@ public function getNumber($value)
8585
*/
8686
public function getPriceFormat()
8787
{
88-
$numberElements = (new DataBundle())->get($this->_localeResolver->getLocale())['NumberElements'];
89-
$format = $numberElements['latn']['patterns']['currencyFormat'];
90-
$symbols = $numberElements['latn']['symbols'];
88+
$localeData = (new DataBundle())->get($this->_localeResolver->getLocale());
89+
$format = $localeData['NumberElements']['latn']['patterns']['currencyFormat']
90+
?: explode(';', $localeData['NumberPatterns'][1])[0];
91+
$decimalSymbol = $localeData['NumberElements']['latn']['symbols']['decimal']
92+
?: $localeData['NumberElements'][0];
93+
$groupSymbol = $localeData['NumberElements']['latn']['symbols']['group']
94+
?: $localeData['NumberElements'][1];
9195

9296
$pos = strpos($format, ';');
9397
if ($pos !== false) {
@@ -120,8 +124,8 @@ public function getPriceFormat()
120124
'pattern' => $this->_scopeResolver->getScope()->getCurrentCurrency()->getOutputFormat(),
121125
'precision' => $totalPrecision,
122126
'requiredPrecision' => $requiredPrecision,
123-
'decimalSymbol' => $symbols['decimal'],
124-
'groupSymbol' => $symbols['group'],
127+
'decimalSymbol' => $decimalSymbol,
128+
'groupSymbol' => $groupSymbol,
125129
'groupLength' => $group,
126130
'integerRequired' => $integerRequired,
127131
];

0 commit comments

Comments
 (0)