BUG: Unique Number Set Does Not Round Correctly with ROUND()

Last reviewed: June 27, 1995
Article ID: Q130727
The information in this article applies to:
  • Microsoft FoxPro for Windows, version 2.6a
  • Microsoft FoxPro for Macintosh, version 2.6a
  • Microsoft FoxPro for MS-DOS, version 2.6a

SYMPTOMS

A unique number set (.07125*533380) does not round correctly depending on the SET DECIMAL TO setting.

RESOLUTION

It rounds correctly if entered in the following way, regardless of the SET DECIMAL TO setting:

   ? ROUND(FIXED(.07125)*FIXED(533380),2)

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Problem

Type the following in the Command window:

   ? (.07125*533380)            Result=38003.32500
   SET DECI TO 8
   ? ROUND(.07125*533380,2)     Result = 38003.33
   SET DECI TO 9
   ? ROUND(.07125*533380,2)     Result = 38003.32

The result is rounded down when SET DECIMAL TO is set to 9 or higher, but the correct result occur when SET DECIMAL TO is set to 8 or lower.


Additional reference words: FoxWin FoxMac FoxDos 2.60a buglist2.60a
KBCategory: kbprg kbbuglist
KBSubcategory: FxprgGeneral


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: June 27, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.