mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8220224: With CLDR provider, NumberFormat.format could not handle locale with number extension correctly
Reviewed-by: darcy
This commit is contained in:
parent
954c66afed
commit
dc3c9c8439
4 changed files with 606 additions and 284 deletions
|
@ -836,7 +836,8 @@ public final class CompactNumberFormat extends NumberFormat {
|
|||
if (ch == QUOTE) {
|
||||
ch = pattern.charAt(index++);
|
||||
if (ch == MINUS_SIGN) {
|
||||
ch = symbols.getMinusSign();
|
||||
sb.append(symbols.getMinusSignText());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
sb.append(ch);
|
||||
|
@ -859,11 +860,14 @@ public final class CompactNumberFormat extends NumberFormat {
|
|||
if (ch == QUOTE) {
|
||||
ch = pattern.charAt(index++);
|
||||
if (ch == MINUS_SIGN) {
|
||||
ch = symbols.getMinusSign();
|
||||
String minusText = symbols.getMinusSignText();
|
||||
FieldPosition fp = new FieldPosition(NumberFormat.Field.SIGN);
|
||||
fp.setBeginIndex(stringIndex);
|
||||
fp.setEndIndex(stringIndex + 1);
|
||||
fp.setEndIndex(stringIndex + minusText.length());
|
||||
positions.add(fp);
|
||||
stringIndex += minusText.length();
|
||||
affix.append(minusText);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
stringIndex++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue