// NOTE: In Java, this method is in NumberFormat.java const char16_t*
getPatternForStyle(const Locale& locale, constchar* nsName, CldrPatternStyle style, UErrorCode& status);
/** * Computes the plural form for this number based on the specified set of rules. * * @param rules A {@link PluralRules} object representing the set of rules. * @return The {@link StandardPlural} according to the PluralRules. If the plural form is not in * the set of standard plurals, {@link StandardPlural#OTHER} is returned instead.
*/ inline StandardPlural::Form getStandardPlural(const PluralRules *rules, const IFixedDecimal &fdec) { if (rules == nullptr) { // Fail gracefully if the user didn't provide a PluralRules return StandardPlural::Form::OTHER;
} else {
UnicodeString ruleString = rules->select(fdec); return StandardPlural::orOtherFromString(ruleString);
}
}
/** * Computes the plural form after copying the number and applying rounding rules.
*/ inline StandardPlural::Form getPluralSafe( const RoundingImpl& rounder, const PluralRules* rules, const DecimalQuantity& dq,
UErrorCode& status) { // TODO(ICU-20500): Avoid the copy?
DecimalQuantity copy(dq);
rounder.apply(copy, status); if (U_FAILURE(status)) { return StandardPlural::Form::OTHER;
} return getStandardPlural(rules, copy);
}
} // namespace utils
} // namespace number::impl
U_NAMESPACE_END
#endif//__NUMBER_UTILS_H__
#endif/* #if !UCONFIG_NO_FORMATTING */
Messung V0.5
¤ Dauer der Verarbeitung: 0.21 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.