Integer to string conversion.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in), | optional | :: | i |
integer value |
|
character(len=*), | intent(out) | :: | s |
integer value stringified |
subroutine integer_to_string(i, s) integer, intent(in), optional :: i !! integer value character(len=*), intent(out) :: s !! integer value stringified integer :: istat !! IO status write(s, int_fmt, iostat=istat) i if (istat/=0) then write(error_unit,'(A)') 'Error converting integer to string' s = '****' else s = adjustl(s) end if end subroutine integer_to_string