John R. Culleton wrote:
On Friday 30 December 2005 04:35 pm, Mojca Miklavec wrote:
\def\enordinalnumber#1% {#1\ifnum\lasttwodigits{#1}=11 \highordinalstr{th}% \else\ifcase\lastdigit{#1}% \highordinalstr{th}% \or % 1 \highordinalstr{st}% \or % 2 \highordinalstr{nd}% \or % 3 \highordinalstr{rd}% \else \highordinalstr{th}% \fi\fi}
And use it as:
\enordinalnumber{1} \enordinalnumber{2} \enordinalnumber{3} \enordinalnumber{4} \enordinalnumber{5} \enordinalnumber{100} ...
It is stored now as part of my "standard macro pack" for Context. Thanks to all.
As I was just reminded by a British Telecom website (which confirmed that I was moving on the "13rd"), I'm used to two more exceptions (suggested as a patch): \def\enordinaldaynumber#1% {#1\ifnum\lasttwodigits{#1}=11 \highordinalstr{th}% \else\ifnum\lasttwodigits{#1}=12 \highordinalstr{th}% \else\ifnum\lasttwodigits{#1}=13 \highordinalstr{th}% \else\ifcase\lastdigit{#1}% \highordinalstr{th}% \or % 1 \highordinalstr{st}% \or % 2 \highordinalstr{nd}% \or % 3 \highordinalstr{rd}% \else \highordinalstr{th}% \fi\fi\fi\fi} -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Adam T. Lindsay, Computing Dept. atl@comp.lancs.ac.uk Lancaster University, InfoLab21 +44(0)1524/510.514 Lancaster, LA1 4WA, UK Fax:+44(0)1524/510.492 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-