rounding with format specifier in prnopts
Stefan Fronzek
sfronzek at SONNENKINDER.ORG
Thu Jul 28 09:42:34 EDT 2005
Hello!
I am using the prnopts setting to specify the format when printing data as
text output. I would like to format my data as integer values and used the
"%5.0f" format specifier (I also tried with %d and %i). It seems now that
rounding of the values is not quite meeting my expectations: a value of 1.5
is printed as 1 instead of 2.
Could anybody tell me the correct format specifyier that I should use here?
Is there a list of possible format specifiers in Grads? The documentation
only refers to the C-language.
The command sequence I used is below.
Best regards,
Stefan
ga-> set gxout print
ga-> set prnopts %5.0f
ga-> d 1.5
Printing Grid -- 1 Values -- Undef = -9.99e+33
1
ga-> d 1.6
Printing Grid -- 1 Values -- Undef = -9.99e+33
2
ga-> d 1.49
Printing Grid -- 1 Values -- Undef = -9.99e+33
1
ga-> d 1.51
Printing Grid -- 1 Values -- Undef = -9.99e+33
2
More information about the gradsusr
mailing list