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 #58817 is a reply to message #58816] Mon, 18 February 2008 04:56 Go to previous messageGo to previous message
Yann Zoll is currently offline  Yann Zoll
Messages: 4
Registered: February 2008
Junior Member
Thx for all the sugestions.

At the moment i use the if conditions. you need one if... per value:

if for example the problem is the time:


hh, mm, ss = hours, minutes, seconds

if hh lt 10 then hh = '0'+string(hh)
if mm lt 10 ....
if ss ...

time = strcompress(hh+':'+mm+':'ss',/REMOVE_ALL)


if you encounter this problem in perl, the code looks like:


time = sprintf("%02d.%02d.%02d",hh,mm,ss)


ok, perl needs no explicit type casting as idl does so the "string()"
command is necessary, but is it possible to assign the output of print
(with the format keyword) to a variable?

yann
[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: Sun Oct 12 04:47:07 PDT 2025

Total time taken to generate the page: 0.72194 seconds