]> granicus.if.org Git - icu/commitdiff
ICU-9531 CompactDecimalFormat to turn grouping separator off in short form only.
authorTravis Keep <keep94@gmail.com>
Wed, 2 Jan 2013 22:31:02 +0000 (22:31 +0000)
committerTravis Keep <keep94@gmail.com>
Wed, 2 Jan 2013 22:31:02 +0000 (22:31 +0000)
X-SVN-Rev: 33009

icu4j/main/classes/core/src/com/ibm/icu/text/CompactDecimalFormat.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/CompactDecimalFormatTest.java

index 94467ab530d651a29f3c567c82af76fa82630289..5f1a619f2c6227821d9888d822a13de52c6c4883 100644 (file)
@@ -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);
index 71fbd00b52c53cf01499f28d215baaec42ecb3a2..fd5c92c9cd34a45455bddc716e17904ead3fabca 100644 (file)
@@ -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 = {