File tree Expand file tree Collapse file tree 3 files changed +19
-8
lines changed
app/code/Magento/Checkout/Model
lib/internal/Magento/Framework/Filter Expand file tree Collapse file tree 3 files changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -135,7 +135,7 @@ protected function normalize($itemQty)
135
135
}
136
136
137
137
$ filter = new LocalizedToNormalized (
138
- ['locale ' => $ this ->resolver ->getLocale (), 'decimal_style ' => NumberFormatter::DECIMAL ]
138
+ ['locale ' => $ this ->resolver ->getLocale (), 'type ' => NumberFormatter::TYPE_DOUBLE ]
139
139
);
140
140
return $ filter ->filter ((string )$ itemQty );
141
141
}
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ class LocalizedToNormalized implements FilterInterface
21
21
'locale ' => null ,
22
22
'date_format ' => null ,
23
23
'precision ' => null ,
24
- 'decimal_style ' => null ,
24
+ 'type ' => null ,
25
25
];
26
26
27
27
/**
@@ -70,10 +70,11 @@ public function filter($value)
70
70
if (is_numeric ($ value )) {
71
71
$ numberParse = new NumberParse (
72
72
$ this ->_options ['locale ' ],
73
- empty ($ this ->_options ['decimal_style ' ])
74
- ? NumberFormatter::PATTERN_DECIMAL
75
- : $ this ->_options ['decimal_style ' ]
73
+ empty ($ this ->_options ['type ' ])
74
+ ? NumberFormatter::TYPE_DOUBLE
75
+ : $ this ->_options ['type ' ]
76
76
);
77
+
77
78
return (string )$ numberParse ->filter ($ value );
78
79
} elseif ($ this ->_options ['date_format ' ] === null && strpos ($ value , ': ' ) !== false ) {
79
80
$ formatter = new IntlDateFormatter (
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ public static function localizedToNormalizedDataProvider()
40
40
'locale ' => 'nl ' ,
41
41
'date_format ' => null ,
42
42
'precision ' => null ,
43
- 'decimal_style ' => NumberFormatter::PATTERN_DECIMAL
43
+ 'type ' => NumberFormatter::TYPE_DOUBLE
44
44
],
45
45
"0.5 "
46
46
],
@@ -50,17 +50,27 @@ public static function localizedToNormalizedDataProvider()
50
50
'locale ' => 'en ' ,
51
51
'date_format ' => null ,
52
52
'precision ' => null ,
53
- 'decimal_style ' => ' '
53
+ 'type ' => ' '
54
54
],
55
55
"0.5 "
56
56
],
57
57
'3 ' => [
58
+ "2 " ,
59
+ [
60
+ 'locale ' => 'en ' ,
61
+ 'date_format ' => null ,
62
+ 'precision ' => null ,
63
+ 'type ' => ''
64
+ ],
65
+ "2 "
66
+ ],
67
+ '4 ' => [
58
68
'2014-03-30 ' ,
59
69
[
60
70
'locale ' => 'en ' ,
61
71
'date_format ' => 'Y-M-d ' ,
62
72
'precision ' => null ,
63
- 'decimal_style ' => ''
73
+ 'type ' => ''
64
74
],
65
75
[
66
76
"date_format " => "Y-M-d " ,
You can’t perform that action at this time.
0 commit comments