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

Home » Public Forums » archive » Re: addition
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: addition [message #39770] Mon, 14 June 2004 06:35
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Thomas Ohde writes:

> It works, but I have the next problem:
>
> IDL> print, STRING(t1+t2)
> IDL> 38005.229
>
> I like to have 38005.22919.

How about this:

IDL> Print, String(t1+t2, Format='(F12.5)')

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: addition [message #39772 is a reply to message #39770] Mon, 14 June 2004 06:15 Go to previous message
Thomas Ohde is currently offline  Thomas Ohde
Messages: 10
Registered: November 2000
Junior Member
>> Try this:
>>
>> IDL> t1=38005.0D
>> IDL> t2=0.22919D
>> IDL> print, t1+t2, format='(F12.5)'
>> 38005.22919

It works, but I have the next problem:

IDL> print, STRING(t1+t2)
IDL> 38005.229

I like to have 38005.22919.

Thomas
Re: addition [message #39774 is a reply to message #39772] Mon, 14 June 2004 05:10 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Thomas Ohde writes:

> I have two values t1=38005.0 and t2=0.22919.
>
> idl> t1=38005.0
> idl> t2=0.22919
> idl> print, t2
> idl> 0.22919
> idl> print, t1+t2
> idl> 38005.2
>
> Why not 38005.22919? Maby because t1 and t2 are float values?

Try this:

IDL> t1=38005.0D
IDL> t2=0.22919D
IDL> print, t1+t2, format='(F12.5)'
38005.22919

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Overplotting 50% lines
Next Topic: Re: does the image size matters?

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

Current Time: Wed Oct 08 19:55:27 PDT 2025

Total time taken to generate the page: 0.00389 seconds