Microsoft KB Archive/64682

Word: No Decimal Places Displayed, Print Merge Math Operation

PSS ID Number: Q64682 Article last modified on 11-02-1994

5.00 5.50 6.00

MS-DOS

= SUMMARY =

If the result of a math operation in a merge has no decimal remainder, Microsoft Word version 5.00 will not insert a decimal with trailing zeros regardless of the values used in the calculation.

Word version 5.00 correctly keeps the decimal places when using F2 to calculate the value by hand. As described in the “Using Microsoft Word” manual on Page 487, “If any of the numbers in the expression are decimal numbers, Word 5.00 uses the maximum number of decimals used in the expression.”

In Word version 5.50, the math operation performed in a print merge handles the decimal and trailing zeros correctly. If any of the numbers in the expression are decimal numbers, Word version 5.50 uses the maximum number of decimals used in the expression. No workaround is necessary to maintain the decimal and trailing zeros in a print merge math operation.

= MORE INFORMATION =

The merge statement <<3.70*40.00>> results in “148” being inserted into the document.

Highlighting the expression and pressing F2 results in “148.00” being placed in the scrap for insertion.

A workaround to recover the decimal and trailing zeros is to use the following statements in the merge document:

<>

This statement records the result of the calculation into the variable called “num”.

Put the following statement into the merge document where the calculated value must appear:

< ><>.00< >

The number will be inserted followed by the result of the IF statement. The IF tests the result to see if it is an integer value. If the value is an integer (with no decimal remainder), “.00” will be inserted into the document following the calculated value.

KBCategory: kbother KBSubcategory: kbmerge Additional reference words: ============================================================================= Copyright Microsoft Corporation 1994.