Showing posts with label formatting. Show all posts
Showing posts with label formatting. Show all posts

Monday, August 9, 2010

Number formatting in the MS-Word field

Refer to my previous post about simple mathematical calculation in Word.
It is also possible to put format for the result of calculation.
For example,

2500 -20*52.88 = 1442.40  (without thousand separator (comma))

We can set the format by the following steps
  1. Shift-F9 to edit the field
  2. After the formula, add the formatting code as \# ,0.00
  3. The field will look like this { =2500-20*52.88 \#,0.00}
  4. Press F9 to update the field
The result will look like this 2500 -20*52.88 = 1,442.40
(with thousand separator and accuracy of 2 decimal places)

Other variations are, for example,

.. \# 0 for rounded whole numbers
.. \# ,0 for rounded whole numbers with a thousands separator
.. \# ,0.00 for numbers accurate to two decimal places, with a thousands separator
.. \# $,0 for rounded whole dollars with a thousands separator
.. \# $,0.00;($,0.00);- for currency, with brackets around negative numbers and a hyphen for 0 values