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

Re: printing floats/integer



you can use the the string command in connection with format

for example
IDL> x=1.222221000000000000000
IDL> print, string(format='(f8.6)',x)
 1.222221

klaus

Sean Heukels <sean77=cuthere=@dds.nl> wrote in message
9881p0$55o$1@newshost.accu.uu.nl">news:9881p0$55o$1@newshost.accu.uu.nl...
> I wrote a small module for integers. The variable is formatted and
returned.
>
> "1         " returns as "1"
>
> Now this doesn't work with floats. for example if I want to print
"1.22221"
> I
> dont want to see it as "1.222221000000000000000" or
> "1.222222                  "
>
> Does anyone know how I can solve this ??
>
> Greets Sean
>
>