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

Re: printing floats/integer



Sean Heukels wrote:
> 
> What if I dont know that the float will
> be 8 in length and has 6 decimals ??

You, as the user of the number, have to specify something about what you want for the
output format. E.g. maximum length, how many decimal places, etc. IDL, and computers in
general, have absolutely no intelligence - that's where the user comes in. :o) If you
don't know what the size of the number will be, use exponential format.

> How can we put this in a subroutine, that handles
> a variable (e.g. PRO FORMAT, var1) and returns
> the right way to print ??

You haven't defined what "right" is in a way a program can understand it. 



-- 
Paul van Delst           A little learning is a dangerous thing;
CIMSS @ NOAA/NCEP        Drink deep, or taste not the Pierian spring;
Ph: (301)763-8000 x7274  There shallow draughts intoxicate the brain,
Fax:(301)763-8545        And drinking largely sobers us again.
paul.vandelst@noaa.gov                   Alexander Pope.