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

Home » Public Forums » archive » Re: anything like sprintf?
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: anything like sprintf? [message #58818 is a reply to message #58817] Mon, 18 February 2008 04:40 Go to previous messageGo to previous message
lasse is currently offline  lasse
Messages: 48
Registered: February 2007
Member
On 18 Feb, 12:28, Yann Zoll <y_z2...@yahoo.de> wrote:
> Hi newsgroup.
>
> I just wonder if there is any good looking way to do apply a preceding
> zero to a string if value is less than 10.
> To build a time string from integer values of hour, minute, second.
> In perl there is the sprintf command to do this. Is there anything like
> this in IDL?
>
> Thx, Yann

Hi,

read about format codes in the IDL manual. There you will find that

x = 4
print, string(x, format='(I02)')

will do exactly that. Personally, I love format codes and that it is
well worth the effort to understand how to use them.

Cheers
Lasse Clausen
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: anything like sprintf?
Next Topic: yaxisformat='exponent' in IDLgrGraphics

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

Current Time: Thu Oct 16 01:26:44 PDT 2025

Total time taken to generate the page: 0.02633 seconds