INTEGER Output: The I Descriptor

The Iw and Iw.m descriptors are for INTEGER output. The general form of these descriptors are as follows:

rIw    and     rIw.m

The meaning of r, w and m are:

  • I is for INTEGER
  • w is the width of field, which indicates that an integer should be printed with w positions.
  • m indicates that at least m positions (of the w positions) must contain digits. If the number to be printed has fewer than m digits, leading 0s are filled. If the number has more than m digits, m is ignored and in this case Iw.m is equivalent to Iw.

    Note that w must be positive and larger than or equal to m.

    It is interesting to note that m can be zero! That is, no digits should be printed. In this case, if the number to be printed is non-zero, it will be printed as if Iw is used. However, if the number is zero, all w positions will be filled with spaces!

  • r is the repetition indicator, which gives the number of times the edit descriptor should be repeated. For example, 3I5.3 is equivalent to I5.3, I5.3, I5.3.
  • The sign of a number also needs one position. Thus, if -234 is printed, w must be larger than or equal to 4. The sign of a positive number is not printed.
  • What if the number of positions is less than the number of digits plus the sign? In other words, what if a value of 12345 is printed with I3? Three positions are not enough to print the value of five digits. In this case, traditionally, all w positions are filled with *'s. Therefore, if you see a sequence of asterisks, you know your edit descriptor does not have enough length to print a number.  

 

سايت فرترن