@@ -17,9 +17,10 @@ class LocalizedToNormalized implements FilterInterface
1717 * @var array
1818 */
1919 protected $ _options = [
20- 'locale ' => null ,
21- 'date_format ' => null ,
22- 'precision ' => null
20+ 'locale ' => null ,
21+ 'date_format ' => null ,
22+ 'precision ' => null ,
23+ 'decimal_style ' => null ,
2324 ];
2425
2526 /**
@@ -60,14 +61,21 @@ public function setOptions(?array $options = null)
6061 *
6162 * Normalizes the given input
6263 *
63- * @param string $value Value to normalized
64+ * @param string $value Value to normalized
6465 * @return string|array The normalized value
6566 */
6667 public function filter ($ value )
6768 {
6869 if (is_numeric ($ value )) {
69- $ numberParse = new NumberParse ($ this ->_options ['locale ' ], NumberFormatter::PATTERN_DECIMAL );
70- return (string ) $ numberParse ->filter ($ value );
70+ $ decimalStyle = $ this ->_options ['decimal_style ' ] ?? null ;
71+ if ($ decimalStyle === null ) {
72+ $ numberParse = new NumberParse ($ this ->_options ['locale ' ], NumberFormatter::PATTERN_DECIMAL );
73+ } elseif ($ decimalStyle === false ) {
74+ $ numberParse = new NumberParse ($ this ->_options ['locale ' ], NumberFormatter::DECIMAL );
75+ } else {
76+ $ numberParse = new NumberParse ($ this ->_options ['locale ' ], $ decimalStyle );
77+ }
78+ return (string )$ numberParse ->filter ($ value );
7179 } elseif ($ this ->_options ['date_format ' ] === null && strpos ($ value , ': ' ) !== false ) {
7280 $ formatter = new IntlDateFormatter (
7381 $ this ->_options ['locale ' ],
0 commit comments