Discussion:
Round numbers to 2 decimal places when using Word Mail Merge
(too old to reply)
ALJ
2005-03-21 15:33:05 UTC
Permalink
How can I limit a mergefield to 2 decimal places using Mail Merge. I am
connected to an Access query that is set up to limit results to 2 decimal
places but it doesn't appear the same in the merged Word Doc. Is there a
switch to accomplish this task or does anyone know of a way I can set the
field up? Thanks!
Andy
Peter Jamieson
2005-03-21 18:23:26 UTC
Permalink
You can try using a numeric formatting switch in Word, e.g. use Alt-F9 to
reveal the appropriate field code and change e.g.

{ MERGEFIELD mynumber }

to

{ MERGEFIELD mynumber \#"0.00" }

- have a look at Word help for other types of formatting you can apply.

You need to check that this does the correct kind of "limit"ing, i.e. if you
want rounding, make sure it does rounding; if you want truncation, make sure
it does that. If it doesn't do the thing you need you may need to change the
way you are limiting the decimal places in your query (and there can be
additional problems if the number comes from a field of type currency).

Peter Jamieson
Post by ALJ
How can I limit a mergefield to 2 decimal places using Mail Merge. I am
connected to an Access query that is set up to limit results to 2 decimal
places but it doesn't appear the same in the merged Word Doc. Is there a
switch to accomplish this task or does anyone know of a way I can set the
field up? Thanks!
Andy
ALJ
2005-03-21 18:33:03 UTC
Permalink
Thanks Peter, that did it!
Post by ALJ
How can I limit a mergefield to 2 decimal places using Mail Merge. I am
connected to an Access query that is set up to limit results to 2 decimal
places but it doesn't appear the same in the merged Word Doc. Is there a
switch to accomplish this task or does anyone know of a way I can set the
field up? Thanks!
Andy
Continue reading on narkive:
Loading...