Convert real to string.
use penf
print "(A)", str(fm=FR8P, n=1._R8P)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | fm |
Format different from the standard for the kind. |
||
real(kind=R8P), | intent(in) | :: | n |
Real to be converted. |
Returned string containing input number.
elemental function strf_R8P(fm, n) result(str) !< Convert real to string. !< !<```fortran !< use penf !< print "(A)", str(fm=FR8P, n=1._R8P) !<``` !=> 0.100000000000000E+001 <<< character(*), intent(in) :: fm !< Format different from the standard for the kind. real(R8P), intent(in) :: n !< Real to be converted. character(DR8P) :: str !< Returned string containing input number. write(str, trim(fm)) n endfunction strf_R8P