View Single Post
  #7   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
 
Posts: n/a
Default Rounding up on a merged field

Are you using Ctrl+F9 to insert each pair of field delimiters { }?

It certainly does work in Word 2003 running under Windows XP

To see more than you wanted to know about field codes, see macropod's Word
Field Maths 'tutorial', at:

http://www.wopr.com/cgi-bin/w3t/show...?Number=365442


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"wmannod" wrote in message
...
Thanks,

But everytime I try this I get a syntax error. I've tried in a fomula and
also the toggle field code and just typing it in. I'm using XP and office
2003. Is there a book I can read that has examples of these codes?

"macropod" wrote:

Hi wmannod,

The 2348.11499999999998 is a by-product of how Excel does its rounding.

You can work around this by embedding your mergefield inside a formula
field, coded like:
{={mergefield total \# 0.000} \# ,0.00}
This will round your 2348.11499999999998 to 2,348.12.

Cheers


"wmannod" wrote in message
...
You are correct. But I don't know why it brings in this number. The
figure

is
coming from an excel spreedsheet that is the total of two feilds that
are

two
decimal places. One field is amount, the other is GST, it is a
calculated
field (=V2*0.07). When the merge is done it brings in the GST and Total
columms in with 14 decimal places. Can I stop this from happening?
Total
field accually reads 2348.11499999999998 in the merge.

"macropod" wrote:

Hi wmannod,

If your source data actually have more than three decimal places, the
2,348.115 that you see when rounding to three decimal places might

really be
2,348.1149 or something such, which would round down to 2,348.11 when
rounded to two decimal places.

Cheers

"wmannod" wrote in message
news Hi I have the decimal places down with {mergefield total \#,##0.00}

But my
amount to the third decimal place is 2,348.115. How do I get the 5
to
round
up. I'm looking for 2348.12 it always rounds down at 5. And give me
a
total
of 2348.11.

thanks in advance.