PluralRules.cardinal constructor
- DataProvider provider,
- Locale locale
Construct an `PluralRules`
for the given locale, for cardinal numbers
See the Rust documentation for try_new_cardinal
for more information.
Throws DataError on failure.
Implementation
factory PluralRules.cardinal(DataProvider provider, Locale locale) {
final result = _icu4x_PluralRules_create_cardinal_mv1(provider._ffi, locale._ffi);
if (!result.isOk) {
throw DataError.values[result.union.err];
}
return PluralRules._fromFfi(result.union.ok, []);
}