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

From: Peter Ajamian (peter@pajamian.dhs.org)
Date: 01/06/01


"Daniel A. Koepke" wrote:
>
> 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.

Right, I had first considered something like that as a solution (only
using a switch in stead of an if / else if ladder construct).  Even mine
will only work for up to 110 days in the month (day 111 will come out as
111st).  If you want to account for this you can modify the first if
statement in my code as follows...

if ((day%100)/10 != 1) {

That will fix it so it can work for virtually any number of days in a
month.  The main reason I didn't do it that way is because it's not
necessary for the stock number of days per month and it's an extra
calculation that the CPU has to perform.

Regards, Peter

--
   +---------------------------------------------------------------+
   | 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