Integer to allocatable string.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | i |
pure function integer_to_string(i) result(s) implicit none integer,intent(in) :: i character(len=:),allocatable :: s integer :: istat allocate( character(len=64) :: s ) ! should be big enough write(s,fmt='(ss,I0)',iostat=istat) i if (istat==0) then s = trim(adjustl(s)) else s = '***' end if end function integer_to_string