]> granicus.if.org Git - icu/commitdiff
ICU-13400 Change name of Grouping strategy from WESTERN to THOUSANDS.
authorShane Carr <shane@unicode.org>
Fri, 9 Feb 2018 22:55:36 +0000 (22:55 +0000)
committerShane Carr <shane@unicode.org>
Fri, 9 Feb 2018 22:55:36 +0000 (22:55 +0000)
X-SVN-Rev: 40887

icu4c/source/i18n/number_grouping.cpp
icu4c/source/i18n/unicode/numberformatter.h
icu4c/source/test/intltest/numbertest_api.cpp
icu4j/main/classes/core/src/com/ibm/icu/impl/number/Grouper.java
icu4j/main/classes/core/src/com/ibm/icu/number/NumberFormatter.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/number/NumberFormatterApiTest.java

index 67fd4c943178085f4c2edc282f5dab884a9bb08c..a2b1bbd6b3388e3bd3c4da3271f60c008ba913a5 100644 (file)
@@ -44,7 +44,7 @@ Grouper Grouper::forStrategy(UGroupingStrategy grouping) {
         return {-2, -2, -3};
     case UNUM_GROUPING_ON_ALIGNED:
         return {-4, -4, 1};
-    case UNUM_GROUPING_WESTERN:
+    case UNUM_GROUPING_THOUSANDS:
         return {3, 3, 1};
     default:
         U_ASSERT(FALSE);
index d2c70a990559385dadce5439272b01f41b13ca01..1152f154ed44266f625193d09407239a08d709e0 100644 (file)
@@ -172,7 +172,7 @@ typedef enum UNumberUnitWidth {
  * <li>MIN2: 1234 and 12,34,567
  * <li>AUTO: 1,234 and 12,34,567
  * <li>ON_ALIGNED: 1,234 and 12,34,567
- * <li>WESTERN: 1,234 and 1,234,567
+ * <li>THOUSANDS: 1,234 and 1,234,567
  * </ul>
  *
  * <p>
@@ -248,7 +248,7 @@ typedef enum UGroupingStrategy {
      *
      * @draft ICU 61
      */
-    UNUM_GROUPING_WESTERN
+    UNUM_GROUPING_THOUSANDS
 
 } UGroupingStrategy;
 
index 2d625877f304b0725dfa6f3830a4ae95b7f0d82f..783bb00e2f615dab2e444590014b2e4e402af361 100644 (file)
@@ -1097,6 +1097,20 @@ void NumberFormatterApiTest::grouping() {
             u"8.765",
             u"0");
 
+    assertFormatDescendingBig(
+            u"Indic locale with THOUSANDS grouping",
+            NumberFormatter::with().grouping(UNUM_GROUPING_THOUSANDS),
+            Locale("en-IN"),
+            u"87,650,000",
+            u"8,765,000",
+            u"876,500",
+            u"87,650",
+            u"8,765",
+            u"876.5",
+            u"87.65",
+            u"8.765",
+            u"0");
+
     // NOTE: Hungarian is interesting because it has minimumGroupingDigits=4 in locale data
     // If this test breaks due to data changes, find another locale that has minimumGroupingDigits.
     assertFormatDescendingBig(
index add6f66563cae268dd2a91515b791f3a1747ab4a..6e18907dbbc13d9b4a44d1be86c7d2409e8a5ab2 100644 (file)
@@ -37,7 +37,7 @@ public class Grouper {
             return GROUPER_AUTO;
         case ON_ALIGNED:
             return GROUPER_ON_ALIGNED;
-        case WESTERN:
+        case THOUSANDS:
             return GROUPER_WESTERN;
         default:
             throw new AssertionError();
index d66cb2afdec6d4386bf880080aa2234b623203da..dd7651bd820c2bdbcbc622d91760db7b0a82e1c0 100644 (file)
@@ -171,7 +171,7 @@ public final class NumberFormatter {
      * <li>MIN2: 1234 and 12,34,567
      * <li>AUTO: 1,234 and 12,34,567
      * <li>ON_ALIGNED: 1,234 and 12,34,567
-     * <li>WESTERN: 1,234 and 1,234,567
+     * <li>THOUSANDS: 1,234 and 1,234,567
      * </ul>
      *
      * <p>
@@ -259,7 +259,7 @@ public final class NumberFormatter {
          * @provisional This API might change or be removed in a future release.
          * @see NumberFormatter
          */
-        WESTERN
+        THOUSANDS
     }
 
     /**
index eb9cb5f2a2851c7ff47a379214ed0d21c9a8f3d7..fe01e1e3ec9463302395fa1dad11b3138b41b918 100644 (file)
@@ -1175,6 +1175,21 @@ public class NumberFormatterApiTest {
                 "8.765",
                 "0");
 
+        assertFormatDescendingBig(
+                "Indic locale with THOUSANDS grouping",
+                "",
+                NumberFormatter.with().grouping(GroupingStrategy.THOUSANDS),
+                new ULocale("en-IN"),
+                "87,650,000",
+                "8,765,000",
+                "876,500",
+                "87,650",
+                "8,765",
+                "876.5",
+                "87.65",
+                "8.765",
+                "0");
+
         // NOTE: Hungarian is interesting because it has minimumGroupingDigits=4 in locale data
         // If this test breaks due to data changes, find another locale that has minimumGroupingDigits.
         assertFormatDescendingBig(