Ordinal vs Cardinal Plurals
You'll learn how to distinguish between counting numbers ("2 items") and ranking numbers ("2nd place") using Intl.PluralRules.
The Two Types of Plurals
In language, we use numbers two different ways:
- Cardinal plurals count quantities: "1 apple," "2 apples," "5 apples"
- Ordinal plurals express order or rank: "1st place," "2nd place," "3rd place"
Think of cardinals as how many and ordinals as what position.
Different languages have different plural rules for each type. In English, ordinals use suffixes like "-st," "-nd," "-rd," and "-th" (1st, 2nd, 3rd, 4th), while cardinals just add "-s" for most words.
Using the type Option
When creating an Intl.PluralRules instance, specify the type option:
// Cardinal (default) - for counting
const cardinalRules = new Intl.PluralRules('en-US', { type: 'cardinal' });
console.log(cardinalRules.select(1)); // "one"
console.log(cardinalRules.select(2)); // "other"
// Ordinal - for ranking/ordering
const ordinalRules = new Intl.PluralRules('en-US', { type: 'ordinal' });
console.log(ordinalRules.select(1)); // "one" (for "1st")
console.log(ordinalRules.select(2)); // "two" (for "2nd")
console.log(ordinalRules.select(3)); // "few" (for "3rd")
console.log(ordinalRules.select(4)); // "other" (for "4th")
console.log(ordinalRules.select(21)); // "one" (for "21st")
console.log(ordinalRules.select(22)); // "two" (for "22nd")
Notice how ordinal rules return different categories based on the ending digit, helping you pick the right suffix. The default type is 'cardinal' if you don't specify one.
Key Takeaway: Use type: 'cardinal' for quantity-based plurals and type: 'ordinal' for position-based plurals; each returns different grammatical categories to help you format numbers correctly in any language.