Ordinal categories vary by locale. Use the category as an input to a localized suffix table instead of attaching an English ending everywhere.
Worked example
const date = new Date("2026-01-02T13:30:00Z");
console.log(new Intl.PluralRules("en", { type: "ordinal" }).select(22));Result
twoImplementation notes
A plural category is not the final formatted ordinal. Each supported language needs an appropriate mapping or a formatter that supplies the full display value.
Try it yourself
Compare 1, 2, 3, 11 and 21 in the target locale.
Open the Node.js example →Editorial date August 16, 2025 · Published December 6, 2026