Re: variable length of integer



In message <05af24d9-6fdd-4529-b360-299944ea98c5@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>, rudra <bnrj.rudra@xxxxxxxxx> writes
Dear friends,
in a output format specification is given like ,say "format (i5)"
which means, upto 99999 will be written and if the integer is less
then 5 digit, it will be trailed by blanck, like "**999".

Is there any way to write format specification so that it will
automatically adjust the length? so even if the integer is of 3 digit,
it will not be trailed by the blanks?

i0 - which uses a field width chosen to match the number's size

But you need to be using a Fortran-90 compiler or above to use this, such as g95 or gfortran. (That may seem a superfluous remark, but a surprising number of people posting here seem not to know that Fortran has advanced since 1977).

--
Clive Page
.