Convert integer to string.
use penf
print "(A)", str(fm=FI4P, n=1_I4P)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | fm |
Format different from the standard for the kind. |
||
integer(kind=I4P), | intent(in) | :: | n |
Integer to be converted. |
Returned string containing input number.
elemental function strf_I4P(fm, n) result(str) !< Convert integer to string. !< !<```fortran !< use penf !< print "(A)", str(fm=FI4P, n=1_I4P) !<``` !=> 1 <<< character(*), intent(in) :: fm !< Format different from the standard for the kind. integer(I4P), intent(in) :: n !< Integer to be converted. character(DI4P) :: str !< Returned string containing input number. write(str, trim(fm)) n endfunction strf_I4P