• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Ordinal Numbers (1st, 2nd, etc.)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Ordinal Numbers (1st, 2nd, etc.)


  • Subject: Re: Ordinal Numbers (1st, 2nd, etc.)
  • From: Michelle Steiner <email@hidden>
  • Date: Thu, 16 Aug 2001 23:34:55 -0700

On 8/16/01 3:21 PM, Greg Back <email@hidden> wrote:

>Does anyone know of a way to change integers (1, 2, 3) to ordinal numbers
>(1st, 2nd, 3rd)?? I know you can set of equivalent lists and match them up,
>but is there an easier way??

set the stringnumber to text returned of (display dialog "enter an
integer" default answer "")
try
set the enteredNumber to the stringnumber as integer
if the enteredNumber is greater than 10 and the enteredNumber is less
than 14 then
set the ordinal to the stringnumber & "th"
else if text -1 thru -1 of the stringnumber is "1" then
set the ordinal to stringnumber & "st"
else if text -1 thru -1 of the stringnumber is "2" then
set the ordinal to stringnumber & "nd"
else if text -1 thru -1 of the stringnumber is "3" then
set the ordinal to stringnumber & "rd"
else
set the ordinal to (the enteredNumber as text) & "th"
end if
on error
display dialog "I said enter an integer!"
end try

----------------------------------------------------------------------
| Michelle Steiner | We're not human beings having a spiritual |
| | experience. We're spiritual beings |
| email@hidden | having a human experience. |
----------------------------------------------------------------------


  • Follow-Ups:
    • Re: Ordinal Numbers (1st, 2nd, etc.)
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: Trouble with double arrow script
  • Next by Date: Re: Ordinal Numbers (1st, 2nd, etc.)
  • Previous by thread: Re: Ordinal Numbers (1st, 2nd, etc.)
  • Next by thread: Re: Ordinal Numbers (1st, 2nd, etc.)
  • Index(es):
    • Date
    • Thread