Thanks for finding this issue and providing a fix... this fix will be present in next release. -Steve
] On Behalf Of treykinkead [treykinkead@...
Sent: Monday, October 06, 2008 6:15 PM
Subject: [ploticus] seconds lost on datetime stubs - rounding problem in DT_days2datetime (dates.c)
Ploticus rocks, but I'm having an issue...
I'm creating timeline style blots (proc bars) from datetime data and
finding that the stubs seem to placed correctly, but the time
component in their text wrongly has "00" for the seconds.
I believe that DT_days2datetime (dates.c) is to blame -- it seems to
be rounding to the nearest minute. My fix was:
diff dates.c.orig dates.c
< timepart = floor( timepart + 0.5 ); /* remove any rounding error
introduced by above */
> timepart = floor( timepart*60.0 + 0.5 ) / 60.0; /* remove any
rounding error introduced by above */
And my test script:
A 2008-10-01.18:00:24 2008-10-01.18:02:24
B 2008-10-01.18:00:24 2008-10-01.18:03:00
C 2008-10-01.18:01:54 2008-10-01.18:05:24
D 2008-10-01.18:03:00 2008-10-01.18:05:24
rectangle: 1 1 5 3
xscaletype: datetime yyyy-mm-dd.hh:mm:ss
xrange: 2008-10-01.18:00:24 2008-10-01.18:06:00
ycategories: datafield 1
stubs: incremental 1 minute
segmentfields: 2 3
If I'm missing something, please let me know.