comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: incremental time data file.....
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: incremental time data file..... [message #26471 is a reply to message #26328] Thu, 23 August 2001 08:35 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
thompson@orpheus.nascom.nasa.gov (William Thompson) writes:

> "Manish" <mrmanish@bigfoot.com> writes:
>
>> Pavel, thanks for the help, just one more thing!!
>
>> I've altered it to zero fill the hour and minute values, but how do I
>> introduce a zero to fill the values between 0 and 9 seconds in the same way?
>> Essentially, how do you zero fill a floating point value??
>
>> I trust this is an easy thing to fix, but I'd appreciate any help, being
>> only a mere novice....!
>
>> Cheers,
>> Manish
>
> Probably the easiest way is treat everything as integers.
>
> ss = fix(my_time-hh*3600L-mm*60L)
> fsec = round(1E5*(my_time-hh*3600L-mm*60L-ss)) ;Fractional second
> out = transpose([[hh],[mm],[ss],[fsec]])
> print, out[*, 82300:82310], format='(i2.2,":",i2.2,":",i2.2,".",i5.5)'
>
> Also, that way, everything comes out exactly the same string length, e.g.
...

I agree. I also found it was necessary to convert the number of
seconds to integers. Otherwise I was always plagued by bizarre
rounding errors which popped up at awkward moments, and were otherwise
impossible to resolve completely. For example, 04:02:60 or 04:02:-1

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: DLM structures passing
Next Topic: Question/Bug on Transpose

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 13:09:34 PDT 2025

Total time taken to generate the page: 0.48579 seconds