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
@ -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],
|
||||
|
@ -109,6 +109,13 @@ public class CompactDecimalFormatTest extends TestFmwk {
|
||||
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…
Reference in New Issue
Block a user