function getOrdinal(value) { const suffixes = ['th', 'st', 'nd', 'rd']; const normalized = value % 100; return value + (suffixes[(normalized - 20) % 10] || suffixes[normalized] || suffixes[0]); }