-
Type:
Sub-task
-
Resolution: Delivered
-
Priority:
P4
-
Affects Version/s: 26
-
Component/s: core-libs
-
generic
-
generic
[java.text.NumberFormat] now supports lenient parsing of minus signs in negative patterns when [NumberFormat.isStrict()] returns `false`. This behavior is enabled by default and can be disabled with [NumberFormat.setStrict(true)]. When lenient, the concrete implementations, [DecimalFormat] and [CompactNumberFormat], use CLDR's [`parseLenient`](https://unicode.org/reports/tr35/tr35-general.html#Character_Parse_Lenient) data to recognize alternate minus signs. For example, text using the `MINUS SIGN (U+2212)` as the negative prefix is now correctly parsed:
```
jshell> var num = NumberFormat.getNumberInstance().parse("\u22123")
num ==> -3
```
```
jshell> var num = NumberFormat.getNumberInstance().parse("\u22123")
num ==> -3
```