Skip to content

Latest commit

 

History

History
45 lines (28 loc) · 779 Bytes

toOrdinal.md

File metadata and controls

45 lines (28 loc) · 779 Bytes

sussy-util / functions / toOrdinal

toOrdinal

toOrdinal(n): string

Returns the given number as a string with an ordinal suffix indicating its position in an ordered sequence.

Example

// returns '1st'
getOrdinalSuffix(1);

Example

// returns '42nd'
getOrdinalSuffix(42);

Example

// returns '123rd'
getOrdinalSuffix(123);

Parameters

Name Type Description
n number The number to be converted to an ordinal string.

Returns

string

The ordinal string representation of the given number.

Defined in

toOrdinal.ts:18