PNum Function:

The PNum function adds the proper suffix to a number. PNum expects a long as input and returns a string. If the input is anything other than a number, PNum returns Null.

Syntax:
string = PNum(long)
Example Usage:
<%  
response.write PNum(432) & "<BR>"
response.write PNum(185) & "<BR>"
response.write PNum(3)  
%>
The above examples return:
432nd
185th
3rd
ASP Source Code:
<%
Private Function PNum(byVal number)
	Dim tmp, ext
	If IsNumeric( number ) = False Then
		PNum = Null
	Else
		Select Case CInt( Right( number, 2 ) )
			Case 11, 12, 13
				ext = "th"
			Case Else
				tmp = Right( number, 1 )
				Select Case CInt( tmp )
					Case 1
						ext = "st"
					Case 2
						ext = "nd"
					Case 3
						ext = "rd"
					Case Else
						ext = "th"
				End Select
		End Select
		PNum = CStr( number & ext )
	End If
End Function
%>