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