From: Travis Keep Date: Wed, 2 Jan 2013 22:31:02 +0000 (+0000) Subject: ICU-9531 CompactDecimalFormat to turn grouping separator off in short form only. X-Git-Tag: milestone-59-0-1~3240 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=70deaa958c91668f8566ba4c1483eab64d6ed56b;p=icu ICU-9531 CompactDecimalFormat to turn grouping separator off in short form only. X-SVN-Rev: 33009 --- diff --git a/icu4j/main/classes/core/src/com/ibm/icu/text/CompactDecimalFormat.java b/icu4j/main/classes/core/src/com/ibm/icu/text/CompactDecimalFormat.java index 94467ab530d..5f1a619f2c6 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/text/CompactDecimalFormat.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/text/CompactDecimalFormat.java @@ -1,6 +1,6 @@ /* ******************************************************************************* - * Copyright (C) 1996-2012, Google, International Business Machines Corporation and + * Copyright (C) 1996-2013, Google, International Business Machines Corporation and * others. All Rights Reserved. * ******************************************************************************* */ @@ -125,7 +125,9 @@ public class CompactDecimalFormat extends DecimalFormat { setDecimalFormatSymbols(format.getDecimalFormatSymbols()); setMaximumSignificantDigits(3); // default significant digits setSignificantDigitsUsed(true); - setGroupingUsed(false); + if (style == CompactStyle.SHORT) { + setGroupingUsed(false); + } this.pluralRules = PluralRules.forLocale(locale); DecimalFormat currencyFormat = (DecimalFormat) NumberFormat.getCurrencyInstance(locale); diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/CompactDecimalFormatTest.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/CompactDecimalFormatTest.java index 71fbd00b52c..fd5c92c9cd3 100644 --- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/CompactDecimalFormatTest.java +++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/CompactDecimalFormatTest.java @@ -1,6 +1,6 @@ /* ******************************************************************************* - * Copyright (C) 1996-2012, Google, International Business Machines Corporation and + * Copyright (C) 1996-2013, Google, International Business Machines Corporation and * others. All Rights Reserved. * ******************************************************************************* */ @@ -76,7 +76,7 @@ public class CompactDecimalFormatTest extends TestFmwk { {1234567890123f, "1,2 трилиона"}, {12345678901234f, "12 трилиона"}, {123456789012345f, "120 трилиона"}, - {1234567890123456f, "1200 трилиона"}, + {1234567890123456f, "1.200 трилиона"}, }; Object[][] SerbianTestDataLongNegative = { @@ -96,7 +96,7 @@ public class CompactDecimalFormatTest extends TestFmwk { {-1234567890123f, "-1,2 трилиона"}, {-12345678901234f, "-12 трилиона"}, {-123456789012345f, "-120 трилиона"}, - {-1234567890123456f, "-1200 трилиона"}, + {-1234567890123456f, "-1.200 трилиона"}, }; Object[][] JapaneseTestData = {