Re: FROM 5.12345 TO 5.12 [message #24163] |
Sat, 10 March 2001 23:52 |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Mark Chan (chanm@cadvision.com) writes:
> x=[5.12345, 45.378, 1300.3221, ...]
>
> xyouts, 5,7, x[0]
>
> Will give: 5.12345 (in some window)
>
> Want: 5.12
>
> xyouts, 5,7,format='(f4.2)',x[0] ---- not allowed, although the following
> is allowed but not what I need
>
> print,format='(f4.2)',x[0] ---- not what I need
>
>
> Any suggestion?
How about this:
xyouts, 5,7,String(x[0],format='(f4.2)')
:-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|