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