ICU-13148 Adding test for grouping separator symbols override.

X-SVN-Rev: 41286
This commit is contained in:
Shane Carr 2018-04-28 03:53:35 +00:00
parent 6545bac22d
commit fb8f77b512

View File

@ -6096,4 +6096,15 @@ public class NumberFormatTest extends TestFmwk {
result.doubleValue());
}
}
@Test
public void test13148_GroupingSeparatorOverride() throws Exception {
DecimalFormat fmt = (DecimalFormat)NumberFormat.getInstance(new ULocale("en", "ZA"));
DecimalFormatSymbols symbols = fmt.getDecimalFormatSymbols();
symbols.setDecimalSeparator('.');
symbols.setGroupingSeparator(',');
fmt.setDecimalFormatSymbols(symbols);
Number number = fmt.parse("300,000");
assertEquals("Should use custom symbols and not monetary symbols", 300000L, number);
}
}