What is the one-size-fits-all format for numeric number output?

Unfortunately, because the formats require a surrounding pair of parentheses, you cannot concatenate individual formats together into one single format string. That requirement dates back to f77 when character strings were introduced into the language, and that requirement was itself based on the earlier format statements which required the parentheses. So that makes it one of those things that would be difficult to change in future revisions of the language. If you want to print an integer and a real in a single write statement, then just use a format that does that. If you are willing to do it in multiple write statements, then you can do that with canned format strings using the appropriate sequence of advance=‘no’ and advance=‘yes’ (which is the default).

1 Like