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

Last reviewed: September 11, 1997
Article ID: Q59229
5.00 | 5.00 MS-DOS | OS/2 kbprg kbbuglist kbfixlist

The information in this article applies to:

  • Microsoft FORTRAN for MS-DOS and OS/2, version 5.0

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


Additional reference words: 5.00 buglist5.00 fixlist5.10
KBCategory: kbprg kbbuglist kbfixlist
KBSubCategory: FORTLngIss
Solution Type : kbfix


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 11, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.