Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICU-11319 Add tests for compact decimal in zh-Hant and zh-Hant-HK. #166

Merged
merged 2 commits into from
Sep 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions icu4c/source/test/intltest/numbertest_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, Map<String, String>> compactCustomData = new HashMap<String, Map<String, String>>();
Map<String, String> entry = new HashMap<String, String>();
entry.put("one", "Kun");
Expand Down