ordinal - Maple Help

# Online Help

###### All Products    Maple    MapleSim

convert/ordinal

convert an integer to an ordinal string

 Calling Sequence convert( n, 'ordinal' )

Parameters

 n - an integer

Description

 • Conversion of an integer to an ordinal produces a string indicating the ordinal representation of the given integer n.

Examples

 > $\mathrm{convert}\left(0,'\mathrm{ordinal}'\right)$
 ${"0th"}$ (1)
 > $\mathrm{convert}\left(1,'\mathrm{ordinal}'\right)$
 ${"first"}$ (2)
 > $\mathrm{convert}\left(2,'\mathrm{ordinal}'\right)$
 ${"second"}$ (3)
 > $\mathrm{convert}\left(12,'\mathrm{ordinal}'\right)$
 ${"12th"}$ (4)
 > $\mathrm{convert}\left(113,'\mathrm{ordinal}'\right)$
 ${"113th"}$ (5)
 > $\mathrm{convert}\left(123,'\mathrm{ordinal}'\right)$
 ${"123rd"}$ (6)
 > $\mathrm{convert}\left(-7,'\mathrm{ordinal}'\right)$
 ${"-7th"}$ (7)

Compatibility

 • The convert/ordinal command was introduced in Maple 17.
 • For more information on Maple 17 changes, see Updates in Maple 17.

 See Also