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

Home » Public Forums » archive » Re: Padding numbers
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: Padding numbers [message #42309] Thu, 03 February 2005 05:50 Go to previous message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
Michael Wallace wrote:
> I've got a program which prints out the current time, but when it prints
> out the minutes or seconds, there's no 0 padding if the number is in the
> range 0 - 9.
>
> print, systime(/JULIAN), $
> FORMAT = '(C(CDI, X, CMoA, X, CYI, X, CHI, ":", CMI, ":", CSI))'
> 3 Feb 2005 1:53:47
>
> This looks good, but just wait until those seconds roll over.
>
>
> print, systime(/JULIAN), $
> FORMAT = '(C(CDI, X, CMoA, X, CYI, X, CHI, ":", CMI, ":", CSI))'
> 3 Feb 2005 1:54: 2
>
> Not so good. How do I change the format to fill that empty space with a
> zero? Same goes for minutes when they roll over. Thanks.

IDL> print,systime(/JULIAN), FORMAT = $
IDL> '(C(CDI, X, CMoA, X, CYI, X, CHI2.2, ":", CMI2.2, ":", CSI2.2))'
3 Feb 2005 08:49:40
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Zoom out of astronomical image preserving header info
Next Topic: Dynamically resizing arrays

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

Current Time: Sun Oct 12 12:22:08 PDT 2025

Total time taken to generate the page: 0.71235 seconds