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

Home » Public Forums » archive » Re: FROM 5.12345 TO 5.12
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: FROM 5.12345 TO 5.12 [message #24163] Sat, 10 March 2001 23:52
davidf is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: FROM 5.12345 TO 5.12
Next Topic: IDL on Linux Server

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

Current Time: Thu Oct 09 20:03:21 PDT 2025

Total time taken to generate the page: 1.51698 seconds