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 20:17:21 -0400
Give this a try
on addNumericSuffix(thisNum)
set the listIndex to (thisNum mod 10) + 1
if thisNum is less than 11 then
set the numSuffix to item listIndex of ,
{"th", "st", "nd", "rd", "th", "th", "th", "th", "th", "th"}
else if thisNum is greater than 10 and thisNum is less than 20 then
set the numSuffix to item listIndex of ,
{"th", "th", "th", "th", "th", "th", "th", "th", "th", "th"}
else
set the numSuffix to item listIndex of ,
{"th", "st", "nd", "rd", "th", "th", "th", "th", "th", "th"}
end if
return ((thisNum as text) & the numSuffix)
end addNumericSuffix
set x to {}
repeat with nth from 1 to 113
my addNumericSuffix(nth)
set end of x to result
end repeat
X
Jason Bourque