Microsoft KB Archive/104477

= FIX: FoxPro Calculator Returning Incorrect Percentages =

Article ID: 104477

Article Last Modified on 12/3/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft FoxPro 2.6 Standard Edition
 * Microsoft FoxPro 2.6a Standard Edition
 * Microsoft FoxPro 2.0
 * Microsoft FoxPro 2.6 for MS-DOS
 * Microsoft FoxPro 2.6a Standard Edition

-



This article was previously published under Q104477



SYMPTOMS
The FoxPro calculator returns the wrong values when the percent (%) sign is used. Incorrect values are consistently returned regardless of the numbers used in the calculation. For the numbers 2 and 3 divided by any number, the percentage returned appears to be half of what it should be. For higher numbers, it appears as if the calculator is actually inserting a MOD function and returning a percentage of the remainder.



RESOLUTION
To work around this problem, choose the equal sign (=) instead of the percent sign, and then multiply by 100.



STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in Visual FoxPro 3.0b for Windows.



Steps to Reproduce Problem
NOTE: In Visual FoxPro to run the calculator, type the following in the Command window:

ACTIVATE WINDOW CALCULATOR


 * 1) In the calculator, enter 1 divided by 2 and then choose the percent sign. The correct value returned is 50.

NOTE: In Visual FoxPro for Windows, .02 is returned.
 * 1) Clear the value, enter 2 divided by 4, and then choose the percent sign. The value returned is 25 (it should be 50).

NOTE: In Visual FoxPro for Windows, .08 is returned.

Additional query words: VFoxWin FoxWin FoxDos 2.50 2.50a 2.50b buglist2.00 buglist2.50 buglist2.50a buglist2.50b buglist2.60 buglist2.60a fixlist3.00b buglist3.00

Keywords: kbbug kbfix KB104477

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.