Re: [BUG][CODE]Bug in do_time in bpl>=15

From: Daniel A. Koepke (dkoepke@circlemud.org)
Date: 01/06/01


On Sat, 6 Jan 2001, Peter Ajamian wrote:

> So I pulled up do_time in bpl14 and compared it to that in bpl15 and
> 17 (note: I did not look at 16).  I found the following change...

The code in CVS right now is:

  /*  From Nate Winters <wintersn@HOTMAIL.COM>, the old
   *  method '(day %10) == 1', etc would produce interesting
   *  results for the 11st (should be 11th), 12nd (12th), and
   *  13rd (13th).  The following should correct that mixup:
   */
  if ((day == 1) || (day == 21) || (day == 31))
    suf = "st";
  else if ((day == 2) || (day == 22) || (day == 32))
    suf = "nd";
  else if ((day == 3) || (day == 23) || (day == 33))
    suf = "rd";
  else
    suf = "th";

This corrects the problem, but hard-codes the day limit in the ordinal
display (e.g., 41 is displayed as 41th).  Your version gets around this
and works properly in every case I could think of, so I'll change the CVS
code to use yours.

-dak

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/03/01 PST