John R. Culleton wrote:
> It is common to express certain numerals with the suffixes
> st, nd, rd, th,
> with the suffix in a smaller type and raised about .5em
> eg:
> 1st 2nd 3rd 4th 5th.
>
> It is of course possible to cobble these expressions up in macros.
> But it would be handy if they were built in to Context.

As usually, Hans already included (almost) that in the core :)
See the very end of lang-ger.tex and the definition of
\enordinaldaynumber. I don't know why there is \ordinalstr instead of
\highordinalstr used (in contrast to the Dutch one), but you can
(re)define it like:

\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}
...

Mojca
_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

Reply via email to