FIX: Leading Zeros with "P" Edit Descriptor and Zero Value (59229)



The information in this article applies to:

  • Microsoft FORTRAN Compiler for MS-DOS 5.0
  • Microsoft FORTRAN compiler for OS/2 5.0

This article was previously published under Q59229

SYMPTOMS

When an application uses the "P" edit descriptor, the value zero may print with leading zero digits (to the left of the decimal point).

STATUS

Microsoft has confirmed this to be a problem in FORTRAN version 5.0 for MS-DOS and OS/2. This problem was corrected in FORTRAN version 5.1 for MS-DOS and OS/2.

MORE INFORMATION

The "P" edit descriptor provides a "scale factor" for output and is useful to print percentages. The following code example demonstrates this problem. When compiled with FORTRAN version 5.0, the value VAR1 prints with leading zero digits.

Sample Code

C Compile options needed: None

      VAR1 = 0.0000
      VAR2 = 0.0123
      WRITE (*, '(3P, 1X, 2F10.5)') VAR1,  ! outputs 000.00000
     +                              VAR2   ! outputs  12.30000
      END
				

Modification Type:MajorLast Reviewed:10/23/2003
Keywords:kbfix KB59229