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