Using fwrite and controlling decimal places
Meredith Croke
mcroke at AIRDAT.COM
Tue Feb 6 11:35:02 EST 2007
Hi Everyone,
I am new to GrADS and am trying to write a file that has 10 columns of
temperature readings for over 600 times. The problem I am running into
is controlling how far the number extends beyond the decimal point. I
would like there to only be two digits. I tried using 'set dignum 2',
but this didn't work, and from what I can tell it is mainly used for
plotting.
My write line is as follows: f=write (test.dat, ds' 'hs' 'df' 'hf'
0'fff' 'TF' 'TF1' 'TF2' 'TF3' 'TF4' 'TF5' 'TF6' 'TF7' 'TF8' 'TF9,append)
Where all the TF's are the temperatures that I would like to only have 2
numbers after the decimal point.
Is there some format statement I can put in that would fix this problem?
Thanks for your help!
Sincerely,
Meredith
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20070206/a0716478/attachment.html
More information about the gradsusr
mailing list