@@ -82,12 +82,17 @@ public function getNumber($value)
82
82
* Functions returns array with price formatting info
83
83
*
84
84
* @return array
85
+ * @SuppressWarnings(PHPMD.NPathComplexity)
85
86
*/
86
87
public function getPriceFormat ()
87
88
{
88
- $ numberElements = (new DataBundle ())->get ($ this ->_localeResolver ->getLocale ())['NumberElements ' ];
89
- $ format = $ numberElements ['latn ' ]['patterns ' ]['currencyFormat ' ];
90
- $ symbols = $ numberElements ['latn ' ]['symbols ' ];
89
+ $ localeData = (new DataBundle ())->get ($ this ->_localeResolver ->getLocale ());
90
+ $ format = $ localeData ['NumberElements ' ]['latn ' ]['patterns ' ]['currencyFormat ' ]
91
+ ?: explode ('; ' , $ localeData ['NumberPatterns ' ][1 ])[0 ];
92
+ $ decimalSymbol = $ localeData ['NumberElements ' ]['latn ' ]['symbols ' ]['decimal ' ]
93
+ ?: $ localeData ['NumberElements ' ][0 ];
94
+ $ groupSymbol = $ localeData ['NumberElements ' ]['latn ' ]['symbols ' ]['group ' ]
95
+ ?: $ localeData ['NumberElements ' ][1 ];
91
96
92
97
$ pos = strpos ($ format , '; ' );
93
98
if ($ pos !== false ) {
@@ -120,8 +125,8 @@ public function getPriceFormat()
120
125
'pattern ' => $ this ->_scopeResolver ->getScope ()->getCurrentCurrency ()->getOutputFormat (),
121
126
'precision ' => $ totalPrecision ,
122
127
'requiredPrecision ' => $ requiredPrecision ,
123
- 'decimalSymbol ' => $ symbols [ ' decimal ' ] ,
124
- 'groupSymbol ' => $ symbols [ ' group ' ] ,
128
+ 'decimalSymbol ' => $ decimalSymbol ,
129
+ 'groupSymbol ' => $ groupSymbol ,
125
130
'groupLength ' => $ group ,
126
131
'integerRequired ' => $ integerRequired ,
127
132
];
0 commit comments