@stanfordspezi/spezi-web-design-system
Version:
Stanford Biodesign Digital Health Spezi Web Design System
15 lines (14 loc) • 345 B
TypeScript
/**
* Returns the ordinal suffix for a given number.
*
* @example
* ```ts
* getOrdinalSuffix(1) // "st"
* getOrdinalSuffix(2) // "nd"
* getOrdinalSuffix(3) // "rd"
* getOrdinalSuffix(4) // "th"
* getOrdinalSuffix(11) // "th"
* getOrdinalSuffix(21) // "st"
* ```
*/
export declare const getOrdinalSuffix: (num: number) => string;