mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 22:44:49 +00:00
ICU-9577 CompactDecimalFormat to fallback to short form when long form is not available.
X-SVN-Rev: 32386
This commit is contained in:
parent
3e9e1901db
commit
afbf770237
2 changed files with 10 additions and 0 deletions
|
@ -136,6 +136,9 @@ class CompactDecimalDataCache {
|
|||
} else {
|
||||
r = r.getWithFallback(resourcePath);
|
||||
}
|
||||
if (r == null) {
|
||||
return null;
|
||||
}
|
||||
int size = r.getSize();
|
||||
Data result = new Data(
|
||||
new long[MAX_DIGITS],
|
||||
|
|
|
@ -108,6 +108,13 @@ public class CompactDecimalFormatTest extends TestFmwk {
|
|||
public void TestEnglishShort() {
|
||||
checkLocale(ULocale.ENGLISH, CompactStyle.SHORT, EnglishTestData);
|
||||
}
|
||||
|
||||
public void TestNoLongStyleInCLDR() {
|
||||
NumberFormat cdf =
|
||||
NumberFormat.getCompactDecimalInstance(
|
||||
ULocale.forLanguageTag("ar_EG"), CompactStyle.LONG);
|
||||
assertEquals("Missing PatternsLong", "5K", cdf.format(5000));
|
||||
}
|
||||
|
||||
public void TestSerbianShort() {
|
||||
checkLocale(ULocale.forLanguageTag("sr"), CompactStyle.SHORT, SerbianTestDataShort);
|
||||
|
|
Loading…
Add table
Reference in a new issue