nth(
NUMBER
)

The nth( function converts a number into an ordinal.


Parameters

This function has one parameter:

number – an integer value.


Description

Converts a number into an ordinal, i.e. 1=1st, 2=2nd, 3=3rd, 4=4th, etc.

nth(1) ☞ 1st
nth(2) ☞ 2nd
nth(3) ☞ 3rd
nth(4) ☞ 4th
nth(5) ☞ 5th
nth(523) ☞ 523rd

Thanks to David Thompson, Gary Yonaites and Mark Terry.

Note: This function is equivalent to:

str(yournum)+?(yournum=0,"",?(abs(yournum MOD 100 - 12) < 2,"th","thstndrdthththththth"[(yournum MOD 10)*2+1;2]))


See Also


History

VersionStatusNotes
10.0No ChangeCarried over from Panorama 6.0.