"' for variant '" +pluralVariant + "' for 10^" + idx +
" in " + localeAndStyle(locale, style));
}
+ String prefix = fixQuotes(template.substring(0, firstIdx));
+ String suffix = fixQuotes(template.substring(lastIdx + 1));
savePrefixOrSuffix(
- fixQuotes(template.substring(0, firstIdx)), pluralVariant, idx, result.prefixes);
+ prefix, pluralVariant, idx, result.prefixes);
savePrefixOrSuffix(
- fixQuotes(template.substring(lastIdx + 1)), pluralVariant, idx, result.suffixes);
+ suffix, pluralVariant, idx, result.suffixes);
+
+ // If there is effectively no prefix or suffix, ignore the actual
+ // number of 0's and act as if the number of 0's matches the size
+ // of the number
+ if (prefix.trim().length() == 0 && suffix.trim().length() == 0) {
+ return idx + 1;
+ }
// Calculate number of zeros before decimal point.
int i = firstIdx + 1;
{12712345678901f, "13\u00a0bil."},
{127123456789012f, "130\u00a0bil."},
};
+
+ Object[][] SkTestDataLong = {
+ {1000, "1000"},
+ {1572, "1600"},
+ {5184, "5200"},
+ };
public void TestCharacterIterator() {
CompactDecimalFormat cdf =
public void TestCsShort() {
checkLocale(ULocale.forLanguageTag("cs"), CompactStyle.SHORT, CsTestDataShort);
}
+
+ public void TestSkLong() {
+ // For this Locale, we have
+ // 1000 {
+ // few{"0"}
+ // one{"0"}
+ // other{"0"}
+ checkLocale(ULocale.forLanguageTag("sk"), CompactStyle.LONG, SkTestDataLong);
+ }
public void TestSerbianShort() {
checkLocale(ULocale.forLanguageTag("sr"), CompactStyle.SHORT, SerbianTestDataShort);