[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Formatting output



Guillaume Dargaud (dargaud@sung3.ifsi.rm.cnr.it) writes:
 
> I want to format a string output but can't get it straight. Basically I want
> floats to converts to a string with no space, no decimals and no dots.
> I've tried many ways, here's the latest:
> 
> FOR i = 0, OrbNum-1 DO xtn[i]=STRING( $
>  fix(OrbArray[i,0]),fix(OrbArray[i,5]),$
>  fix(OrbArray[i,6]), FORMAT='(I," ",I,"h",I)')
> 
> But it comes out with spaces...

I'm not sure exactly what you are trying to do
here, because you a putting at least one space
in with your format statement. But you could
probably eliminate most of the others by
using I0 as the integer format specifier.
The zero indicates that IDL should use the
"natural" width of the number.

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