Microsoft KB Archive/80198

= Microsoft Knowledge Base =

File: Rounding Error with Certain Numbers
Last reviewed: October 27, 1994

Article ID: Q80198

Summary:

A rounding error may occur in Microsoft File when you use a formula to compute the value to be placed into a field. This happens most frequently when the solution to the formula used to compute the value of a field is zero. Instead of displaying 0.00 in the field, File displays the value 0.000000000001.

The best way to correct this problem is to add .00001 to the numbers in fields that are used in the calculation. This corrects the rounding error so that File displays 0.0 in the computed field.

The error may also be adjusted for by subtracting 0.001 in the formula for the field (making the formula for the computed field &quot;F1 - F2 + F3 - 0.001&quot;), but doing this may disrupt the answers in the other fields of the data file where the numbers used do not produce a rounding error.

More Information:

Steps to Reproduce Problem

 * 1) Create a form with four fields: F1, F2, F3, and F4.
 * 2) Format fields F1, F2, and F3 as number fields. Format F4 as a computed number field.
 * 3) In the form, double-click the F1 field. This opens the Format Number Field dialog box.
 * 4) Under Display, select the Decimal option button.
 * 5) In the Decimals box, type 2. Then choose the OK button.
 * 6) Repeat steps 3 through 5 for fields F2 and F3.
 * 7) Repeat steps 3 through 5 for field F4, but type the formula &quot;F1 - F2 + F3&quot; (without quotation marks) in the Formula box before choosing the OK button.
 * 8) Type 9815.13 in F1, 10155.33 in F2, 340.20 in F3.

The displayed value in F4 is 0.000000000001 instead of 0.00.