ICU-13400 Change name of Grouping strategy from WESTERN to THOUSANDS.

X-SVN-Rev: 40887
This commit is contained in:
Shane Carr 2018-02-09 22:55:36 +00:00
parent c8d0e34905
commit ae263452f6
6 changed files with 35 additions and 6 deletions

View 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);

View 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;

View 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(

View 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();

View 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
}
/**

View 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(