NuMFor 9f2ab49 (2024-04-08)
Numerical (Modern) Fortran. Library for Simple Numerical computing
str Interface Reference

str() converts a number (integer or real) to a string More...

Public Member Functions

character(len=:) function, allocatable c2str (sin)
 
character(len=:) function, allocatable i2str (nin)
 
character(len=:) function, allocatable r2str (rin)
 
character(len=:) function, allocatable dp2str (rin)
 
character(len=:) function, allocatable z2str (zin)
 z2str gives a string representation of a complex number
 
function dparr2str (vec)
 
function zarr2str (vec)
 
function iarr2str (vec)
 
function rarr2str (vec)
 
character(len=:) function, allocatable dparr2d2str (vec)
 
character(len=:) function, allocatable zarr2d2str (vec)
 
character(len=:) function, allocatable iarr2d2str (vec)
 
character(len=:) function, allocatable rarr2d2str (vec)
 

Detailed Description

str() converts a number (integer or real) to a string

Use:

USE strings, only: str
print *, 'I2str: - int:', 123, '- string: |'//str(123)//'|'
print *, 'r2str: - real:', 123.121000_4, '- string: |'//str(123.12100_4)//'|'
print *, 'dp2str: - real:', 123.1221_8, '- string: |'//str(123.1221_8)//'|'
print *, 'dp2str: - real:', -123.121_8, '- string: |'//str(-123.121_8)//'|'
print *, 'dp2str: - real:', -123.1221e-12_8, '- string: |'//str(-123.1221e-12_8)//'|'
str() converts a number (integer or real) to a string
Definition strings.f90:50
This module defines functions to manipulate strings of characters. Description.
Definition strings.f90:7

Gives:

! I2str: - int: 123 - string: |123|
! r2str: - real: 123.121002 - string: |123.121002|
! dp2str: - real: 123.12210000000000 - string: |123.1221|
! dp2str: - real: -123.12100000000000 - string: |-123.121|
! dp2str: - real: -1.2312210000000001E-010 - string: |-0.12312210000000001E-009|
!

Member Function/Subroutine Documentation

◆ c2str()

character(len=:) function, allocatable c2str ( character(len=*), intent(in) sin)
Parameters
[in]sinOriginal string
Returns
String converted

◆ dp2str()

character(len=:) function, allocatable dp2str ( real(dp), intent(in) rin)
Parameters
[in]rinnumber to convert
Returns
String converted

References strings::find(), strings::lower(), strings::lstrip(), strings::rstrip(), and strings::strip().

Here is the call graph for this function:

◆ dparr2d2str()

character(len=:) function, allocatable dparr2d2str ( real(dp), dimension(:, :), intent(in) vec)
Parameters
[in]vecVector of numbers to convert
Returns
String created

◆ dparr2str()

function dparr2str ( real(dp), dimension(:), intent(in) vec)
Parameters
[in]vecVector to convert

◆ i2str()

character(len=:) function, allocatable i2str ( integer, intent(in) nin)
Parameters
[in]ninInteger to convert
Returns
String converted

References strings::strip().

Here is the call graph for this function:

◆ iarr2d2str()

character(len=:) function, allocatable iarr2d2str ( integer, dimension(:, :), intent(in) vec)
Returns
String created

◆ iarr2str()

function iarr2str ( integer, dimension(:), intent(in) vec)
Parameters
[in]vecVector to convert

◆ r2str()

character(len=:) function, allocatable r2str ( real(sp), intent(in) rin)
Parameters
[in]rinnumber to convert
Returns
String converted

References strings::find(), strings::lower(), strings::lstrip(), strings::rstrip(), and strings::strip().

Here is the call graph for this function:

◆ rarr2d2str()

character(len=:) function, allocatable rarr2d2str ( real(sp), dimension(:, :), intent(in) vec)
Returns
String created

◆ rarr2str()

function rarr2str ( real(sp), dimension(:), intent(in) vec)
Parameters
[in]vecVector to convert

◆ z2str()

character(len=:) function, allocatable z2str ( complex(dp), intent(in) zin)

z2str gives a string representation of a complex number

Returns
String representation

◆ zarr2d2str()

character(len=:) function, allocatable zarr2d2str ( complex(dp), dimension(:, :), intent(in) vec)
Returns
String created

◆ zarr2str()

function zarr2str ( complex(dp), dimension(:), intent(in) vec)
Parameters
[in]vecVector to convert

The documentation for this interface was generated from the following file: