Quibbler wrote:Ok I eventually found your reference to print using
6) You can use PRINT #n USING to control how many maximum decimal places you need in your result to the output file. If for some reason you're not gonna use the PRINT USING, then you will need some extra code to normalize the result before writing it to the output file. Tell us what you're going to do.
I cannot see the problems you seem to see in format statements, the rounding is just what most people are looking for. I don't understand the example with the trailing minus either.
x=-123.4567:y=456.789
print using "####.## ####.##";x;y
-123.46 456.79
I don't know what you mean by "format statements". I did not use this terminology.
In your example, the mask of "####.##" tends to imply that it can handle up to 4 significant digits.
1) If you give it a positive value with up to 4 significant digits, it works.
2) If you give it a negative value with up to 3 significant digits, it also works, with a leading minus sign taking the place of the high-order digit of the 4 significant digits.
3) However, if you give it a negative value with 4 significant digits, the result will contain a leading % to indicate an error, because it has no place to put the leading minus sign.
Because of this, we always used the mask with the trailing minus sign, like "####.##-" or "#,###.##-" to allow the correct number of leading digits, regardless of the sign, and a trailing minus sign for negative values.
I hope this now makes sense to you.
*****