nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [nmh-workers] Ordinal Indicators.


From: Ralph Corderoy
Subject: Re: [nmh-workers] Ordinal Indicators.
Date: Mon, 08 Jul 2019 15:04:52 +0100

Hi Ken,

> > This is true.  To correct that, I note mh-format(5) too has no
> > function to produce the ordinal suffix.  :-)
>
> Fixed.

Impressively quick work.

    +               int digit = value % 10;
    +               const char *suffix;
    +
    +               switch (digit) {
    +               case 1:
    +                   suffix = "st";
    +                   break;
    +               case 2:
    +                   suffix = "nd";
    +                   break;
    +               case 3:
    +                   suffix = "rd";
    +                   break;
    +               default:
    +                   suffix = "th";
    +               }

Were you paying attention to kre's sh and my sed?  :-)

-- 
Cheers, Ralph.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]