From fb8f77b512461a061e82c802ba2d432e3857cd58 Mon Sep 17 00:00:00 2001 From: Shane Carr Date: Sat, 28 Apr 2018 03:53:35 +0000 Subject: [PATCH] ICU-13148 Adding test for grouping separator symbols override. X-SVN-Rev: 41286 --- .../com/ibm/icu/dev/test/format/NumberFormatTest.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/NumberFormatTest.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/NumberFormatTest.java index 322bf3a116..3cd2cc6dba 100644 --- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/NumberFormatTest.java +++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/NumberFormatTest.java @@ -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); + } }