Function ordinal

  • Returns the suffix that can be added to a number to indicate the position in an ordered sequence, for example 1st, 42nd, or 111th.

    Parameters

    • number: number

      the number to determine the ordinal suffix of.

    Returns string

    • the ordinal suffix that will be st, nd, rd, or th.