plural_rules library

The appropriate locale-dependent plural form.

The PluralRules object returns the PluralCategory of the input num to PluralRules.select. While English only uses 'one' and 'other', other languages have more plural forms. For example, Arabic uses 'zero', 'one', 'two', 'few', 'many', and 'other'.

Example:

import 'package:intl4x/plural_rules.dart';

void main() {
  final rules = PluralRules(locale: Locale.parse('en-US'));
  print(rules.select(3)); // prints 'PluralCategory.other'
}

Classes

Digits
Locale
Representing a Unicode locale identifier.
PluralRules
Determines the correct plural category for a number based on a locale.

Enums

PluralCategory
Defines the locale-specific grammatical categories for plural forms.
PluralType
The number type to use.
RoundingMode
TrailingZeroDisplay