strz_I1P Function

private elemental function strz_I1P(n, nz_pad) result(str)

Arguments

TypeIntentOptionalAttributesName
integer(kind=I1P), intent(in) :: n
integer(kind=I4P), intent(in), optional :: nz_pad

Return Value character


Called by

proc~~strz_i1p~~CalledByGraph proc~strz_i1p strz_I1P interface~strz strz interface~strz->proc~strz_i1p program~volatile_doctest~80 volatile_doctest program~volatile_doctest~80->interface~strz program~volatile_doctest~234 volatile_doctest program~volatile_doctest~234->interface~strz program~volatile_doctest~282 volatile_doctest program~volatile_doctest~282->interface~strz program~volatile_doctest~222 volatile_doctest program~volatile_doctest~222->interface~strz program~volatile_doctest~480 volatile_doctest program~volatile_doctest~480->interface~strz program~volatile_doctest~588 volatile_doctest program~volatile_doctest~588->interface~strz program~volatile_doctest~636 volatile_doctest program~volatile_doctest~636->interface~strz program~volatile_doctest~974 volatile_doctest program~volatile_doctest~974->interface~strz program~volatile_doctest~39 volatile_doctest program~volatile_doctest~39->interface~strz program~volatile_doctest~91 volatile_doctest program~volatile_doctest~91->interface~strz program~volatile_doctest~301 volatile_doctest program~volatile_doctest~301->interface~strz program~volatile_doctest~399 volatile_doctest program~volatile_doctest~399->interface~strz program~volatile_doctest~10 volatile_doctest program~volatile_doctest~10->interface~strz program~volatile_doctest~312 volatile_doctest program~volatile_doctest~312->interface~strz program~volatile_doctest~478 volatile_doctest program~volatile_doctest~478->interface~strz program~volatile_doctest~1012 volatile_doctest program~volatile_doctest~1012->interface~strz program~volatile_doctest~1064 volatile_doctest program~volatile_doctest~1064->interface~strz program~volatile_doctest~1232 volatile_doctest program~volatile_doctest~1232->interface~strz program~volatile_doctest~61 volatile_doctest program~volatile_doctest~61->interface~strz program~volatile_doctest~13 volatile_doctest program~volatile_doctest~13->interface~strz program~volatile_doctest~437 volatile_doctest program~volatile_doctest~437->interface~strz program~volatile_doctest~489 volatile_doctest program~volatile_doctest~489->interface~strz program~volatile_doctest~657 volatile_doctest program~volatile_doctest~657->interface~strz program~volatile_doctest~835 volatile_doctest program~volatile_doctest~835->interface~strz program~volatile_doctest~983 volatile_doctest program~volatile_doctest~983->interface~strz program~volatile_doctest~1151 volatile_doctest program~volatile_doctest~1151->interface~strz program~volatile_doctest~408 volatile_doctest program~volatile_doctest~408->interface~strz program~volatile_doctest~576 volatile_doctest program~volatile_doctest~576->interface~strz program~volatile_doctest~806 volatile_doctest program~volatile_doctest~806->interface~strz program~volatile_doctest~878 volatile_doctest program~volatile_doctest~878->interface~strz program~volatile_doctest~986 volatile_doctest program~volatile_doctest~986->interface~strz program~volatile_doctest~1034 volatile_doctest program~volatile_doctest~1034->interface~strz program~volatile_doctest~1230 volatile_doctest program~volatile_doctest~1230->interface~strz program~volatile_doctest~411 volatile_doctest program~volatile_doctest~411->interface~strz program~volatile_doctest~459 volatile_doctest program~volatile_doctest~459->interface~strz program~volatile_doctest~655 volatile_doctest program~volatile_doctest~655->interface~strz program~volatile_doctest~797 volatile_doctest program~volatile_doctest~797->interface~strz program~volatile_doctest~809 volatile_doctest program~volatile_doctest~809->interface~strz program~volatile_doctest~857 volatile_doctest program~volatile_doctest~857->interface~strz program~volatile_doctest~1053 volatile_doctest program~volatile_doctest~1053->interface~strz program~volatile_doctest~1189 volatile_doctest program~volatile_doctest~1189->interface~strz program~volatile_doctest~1241 volatile_doctest program~volatile_doctest~1241->interface~strz program~volatile_doctest~82 volatile_doctest program~volatile_doctest~82->interface~strz program~volatile_doctest~260 volatile_doctest program~volatile_doctest~260->interface~strz program~volatile_doctest~614 volatile_doctest program~volatile_doctest~614->interface~strz program~volatile_doctest~666 volatile_doctest program~volatile_doctest~666->interface~strz program~volatile_doctest~876 volatile_doctest program~volatile_doctest~876->interface~strz program~volatile_doctest~1160 volatile_doctest program~volatile_doctest~1160->interface~strz program~volatile_doctest volatile_doctest program~volatile_doctest->interface~strz program~volatile_doctest~231 volatile_doctest program~volatile_doctest~231->interface~strz program~volatile_doctest~303 volatile_doctest program~volatile_doctest~303->interface~strz program~volatile_doctest~585 volatile_doctest program~volatile_doctest~585->interface~strz program~volatile_doctest~887 volatile_doctest program~volatile_doctest~887->interface~strz program~volatile_doctest~1055 volatile_doctest program~volatile_doctest~1055->interface~strz program~volatile_doctest~1163 volatile_doctest program~volatile_doctest~1163->interface~strz program~volatile_doctest~1211 volatile_doctest program~volatile_doctest~1211->interface~strz

Contents

Source Code


Source Code

   elemental function strz_I1P(n, nz_pad) result(str)
   !< Convert integer to string, prefixing with the right number of zeros.
   !<
   !<```fortran
   !< use penf
   !< print "(A)", strz(n=1_I1P)
   !<```
   !=> 001 <<<
   !<
   !<```fortran
   !< use penf
   !< print "(A)", strz(n=1_I1P, nz_pad=3)
   !<```
   !=> 001 <<<
   integer(I1P), intent(in)           :: n      !< Integer to be converted.
   integer(I4P), intent(in), optional :: nz_pad !< Number of zeros padding.
   character(DI1P)                    :: str    !< Returned string containing input number plus padding zeros.

   write(str,FI1PZP) n                              ! Casting of n to string.
   str=str(2:)                                      ! Leaving out the sign.
   if (present(nz_pad)) str=str(DI1P-nz_pad:DI1P-1) ! Leaving out the extra zeros padding
   endfunction strz_I1P