Re: Ordinal Numbers (1st, 2nd, etc.)
Re: Ordinal Numbers (1st, 2nd, etc.)
- Subject: Re: Ordinal Numbers (1st, 2nd, etc.)
- From: Jason Bourque <email@hidden>
- Date: Thu, 16 Aug 2001 22:05:20 -0400
Ok one last try
on addNumericSuffix(thisNum)
if thisNum is 0 then return 0
set tempNum to "0" & thisNum
set numSuffix to "th"
if (character -2 of tempNum) is not "1" and (character -1 of tempNum) is
in {"1", "2", "3"} then
set numSuffix to item (character -1 of tempNum) of {"st", "nd",
"rd"}
end if
(thisNum & numSuffix) as text
end addNumericSuffix
--Test it
set x to {}
repeat with nth from 1 to 114
my addNumericSuffix(nth)
set end of x to result
end repeat
X
Jason Bourque