I have some floating point numbers that I need to output from a Fortran program. Let's say the maximum number could be 999.9999 and they are all non-negative. I need zero-padding in front of all numbers less than 100.
For instance, if I have 25.6893782, 245.354567, and 1.2345678, I need to print them out in a form something like
025.6894
245.3546
001.2346
How can I do this? It would be fairly easy with the T
edit descriptor if I knew that, for instance, all numbers would be between 10 and 99, something like that. But there is no way for me to know that ahead of time.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…