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

Home » Public Forums » archive » Re: Digits in IDL
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: Digits in IDL [message #67855 is a reply to message #67854] Tue, 25 August 2009 09:37 Go to previous message
Spon is currently offline  Spon
Messages: 178
Registered: September 2007
Senior Member
On Aug 25, 4:33 pm, Nusret Sevinç <nusretsev...@gmail.com> wrote:
> Hi there,
>
> I am dealing with a time conversion and I have an easy question. I
> want to display a date in this format: 2009-01-01
>
> I have three distinct arrays for year, month and date. I am trying to
> combine the three arrays in the print section and I have no problem
> with combining. My month and date arrays are like this:
>
>   1
>   2
>   3
>   4
>   5
>   6
>   7
>   8
>   9
> 10
> ...
> When I combine those three arrays, I have this date: 2009- 1- 1  (you
> see, there are 0's missing)
>
> Can you please tell me how to put that zeros there?
> Thanks in advance,
> Nusret

Hi Nusret,

you can do this using format codes, either with PRINT or STRING.

e.g.
print, indgen(12)+1, format='(I2)'

Regards,
Chris
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Speed-up of code
Next Topic: Re: data criteria

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

Current Time: Sat Nov 29 17:03:38 PST 2025

Total time taken to generate the page: 1.35689 seconds