This is probably a very basic question but I can't seem to find the answer on google or through searching though this forum (most likely due to poor phraseology of the problem).
I am looking for an intrinsic Fortran function to give me the number of positions used by an integer. What I mean by this is, if an integer is 12543 then the number of positions used is 5 (it will always be positive). The reason I want this is so that when using a WRITE statement with formatted output I can specify the "w" in "Iw" and use the minimum spacing possible.
More specifically:
WRITE(*,"(/ A,Iw,1X,A,Iw)") "All particles within radius ",radius, "of particle index number", p_o_i
Where radius and p_o_i are specified by the user earlier on.
I can write something to achieve this easily enough but I thought that there must be an intrinsic function which can achieve this.
I have been going through the functions here but without much luck. Thanks for the help.