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 #42733 is a reply to message #42439] Mon, 21 February 2005 09:13 Go to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Thu, 03 Feb 2005 17:19:25 -0600, Michael Wallace wrote:

>> 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
>
> Thanks, that did it. This is what I get for not being raised on FORTRAN
> format codes. ;-)

With IDL6.1, you can zero-pad like this as well:

IDL> print,FORMAT='(I02)',3
03

Why is this any better? Because you can do it with floating point
values too:

IDL> print,FORMAT='(F08.5)',!PI
03.14159

It also gracefully degrades to blank padding in versions <6.1.

JD
[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 07:15:49 PDT 2025

Total time taken to generate the page: 0.40251 seconds