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.
Graham Mayor - 28 Apr 2006 06:50 GMT
Word should produce 2348.12 without interference if you use a switch eg \#
",0.00" but if for some reason I cannot fathom it is not doing so then you
could force the same effect with calculated fields eg
{IF { Mergefield Total \# ".000" } = ".??5" "{ =({ Mergefield Total \#
",0.00" } + .01) \# ",0.00" }" "{Mergefield Total \# ",0.00" }" }
would produce the result you require.

Signature
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> 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.
macropod - 28 Apr 2006 14:49 GMT
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
> 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.
wmannod - 28 Apr 2006 17:49 GMT
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.
> Hi wmannod,
>
[quoted text clipped - 13 lines]
> >
> > thanks in advance.
macropod - 29 Apr 2006 13:21 GMT
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
> 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
[quoted text clipped - 20 lines]
> > >
> > > thanks in advance.
wmannod - 01 May 2006 17:02 GMT
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?
> Hi wmannod,
>
[quoted text clipped - 35 lines]
> > > >
> > > > thanks in advance.
Doug Robbins - Word MVP - 01 May 2006 18:44 GMT
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/showthreaded.pl?Number=365442

Signature
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
> Thanks,
>
[quoted text clipped - 47 lines]
>> > > >
>> > > > thanks in advance.