diff --git a/icu4c/source/test/intltest/numbertest_api.cpp b/icu4c/source/test/intltest/numbertest_api.cpp index ec8da929244f..78a8d27282de 100644 --- a/icu4c/source/test/intltest/numbertest_api.cpp +++ b/icu4c/source/test/intltest/numbertest_api.cpp @@ -403,6 +403,22 @@ void NumberFormatterApiTest::notationCompact() { 9990000, u"10M"); + assertFormatSingle( + u"Compact in zh-Hant-HK", + u"compact-short", + NumberFormatter::with().notation(Notation::compactShort()), + Locale("zh-Hant-HK"), + 1e7, + u"10M"); + + assertFormatSingle( + u"Compact in zh-Hant", + u"compact-short", + NumberFormatter::with().notation(Notation::compactShort()), + Locale("zh-Hant"), + 1e7, + u"1000\u842C"); + // NOTE: There is no API for compact custom data in C++ // and thus no "Compact Somali No Figure" test } diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/number/NumberFormatterApiTest.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/number/NumberFormatterApiTest.java index 761b4e11eef9..90e0fc28df30 100644 --- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/number/NumberFormatterApiTest.java +++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/number/NumberFormatterApiTest.java @@ -369,6 +369,22 @@ public void notationCompact() { 9990000, "10M"); + assertFormatSingle( + "Compact in zh-Hant-HK", + "compact-short", + NumberFormatter.with().notation(Notation.compactShort()), + new ULocale("zh-Hant-HK"), + 1e7, + "10M"); + + assertFormatSingle( + "Compact in zh-Hant", + "compact-short", + NumberFormatter.with().notation(Notation.compactShort()), + new ULocale("zh-Hant"), + 1e7, + "1000\u842C"); + Map> compactCustomData = new HashMap>(); Map entry = new HashMap(); entry.put("one", "Kun");