Re: Ordinal Numbers (1st, 2nd, etc.)
Re: Ordinal Numbers (1st, 2nd, etc.)
- Subject: Re: Ordinal Numbers (1st, 2nd, etc.)
- From: Nigel Garvey <email@hidden>
- Date: Sat, 18 Aug 2001 00:49:05 +0100
Paul Berkowitz wrote on Fri, 17 Aug 2001 09:09:15 -0700:
>
On 8/17/01 2:47 AM, "Nigel Garvey" <email@hidden>
>
wrote:
>
>
> That's very nice! :-) Just to speed it up a bit:
>
>
>
> on addNumericSuffix(thisNum)
>
> set {tens, units} to {thisNum mod 100 div 10, thisNum mod 10}
>
> if units is in {1, 2, 3} and tens is not 1 then
>
> item units of {"st", "nd", "rd"}
>
> else
>
> "th"
>
> end if
>
> return "" & thisNum & result
>
> end addNumericSuffix
>
>
Best of show! One picky detail - to avoid making AS do a coercion, it should
>
really be:
>
>
if {units} is in {1, 2, 3} and tens is not 1 then
It doesn't seem to make any difference over 10000 iterations on my slower
machine. It takes just as long to put something into a list as to coerce
it into one.
>
> Is there a proper English way to ordinalise negatives and fractional
>
> numbers? Minus oneth or minus first? 3.2th or 3.2nd?
>
>
Come on, Nigel! I don't think ordinals exist except for integers - there's
>
no such thing as a fractional ordinal. (And if there were, it would have to
>
be "third-and-two-tenth" or something nutty like that). Negative ordinals?
>
How about "first below zero"?
Sorry, Paul. :-) You'll have to make allowances for my Irish ancestry and
the fact that I was asking about English rather than ordinals. It's
possible to *say* something like "the minus oneth position on the x axis"
or "he fell over on the five and a halfth lap" and have someone on the
same wavelength understand what you mean. It's also a pleasant surprise
to find that AppleScript gives the expected result with:
-1th character of "There's no such thing as a negative ordinal!"
NG