Re: addition [message #39770] |
Mon, 14 June 2004 06:35 |
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  |
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  |
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/
|
|
|