- Home
·
- String Manipulation
·
- Function to add a post script to a number. th(91) will return 91st, and th(52) will return 52nd.
Function to add a post script to a number. th(91) will return 91st, and th(52) will return 52nd.
Function to add a post script to a number. th(91) will return 91st, and th(52) will return 52nd.
Rate Function to add a post script to a number. th(91) will return 91st, and th(52) will return 52nd.
(1(1 Vote))
Optional Fmt As String = "###,###,###") As String
Dim v As Long
v = Val(Right(str(Val(S)), 2))
Select Case v
Case 1, 21, 31, 41, 51, 61, 71, 81, 91
th = "st"
Case 2, 22, 32, 42, 52, 62, 72, 82, 92
th = "nd"
Case 3, 23, 33, 43, 53, 63, 73, 83, 93
th = "rd"
Case Else
th = "th"
End Select
th = Format(S, Fmt) & th
End Function
Function to add a post script to a number. th(91) will return 91st, and th(52) will return 52nd. Comments
No comments yet — be the first to post one!
Post a Comment