[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: FROM 5.12345 TO 5.12
- Subject: Re: FROM 5.12345 TO 5.12
- From: davidf(at)dfanning.com (David Fanning)
- Date: Sun, 11 Mar 2001 00:52:21 -0700
- Newsgroups: comp.lang.idl-pvwave
- Organization: Fanning Software Consulting
- References: <98f4t3$q14$1@news3.cadvision.com>
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:23938
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