Decimals appear if they are greater than ".00" - can somebody help

M

maggie

hello,

I have a field that combines two fields. Each of these carries two decimal
places. I read the notes here regarding the use of \#0.00 and reading in the
source as a DDE. I did that and for most of the records, I do see the decimal
places in my combined field. However, whenever the fields are equal to ".00",
I don't carry a decimal value in my combined field. What options do I have?
Here are my fields:

field 1: ${mergefield "sal1"\#0.00}
field 2: ${mergefield "sal2"\#0.00}
combinded field: ${={mergefield sal1\#0.00} +{mergefield sal2\#0.00}

Many thanks for any help.
 
J

John McGhie

I would suggest you need to add an IF field to test for zero.

However you don't say which version of Word, CPU type, and Macintosh OS you
are using, so I can't answer.

I suspect you're on a PC using DDE, you have landed in the Macintosh Word
group (I do wish Microsoft would fix its web interface) and you would be
better off posting in microsoft.public.word.mailmerge.fields, so I have
cross-posted for you.

Cheers

hello,

I have a field that combines two fields. Each of these carries two decimal
places. I read the notes here regarding the use of \#0.00 and reading in the
source as a DDE. I did that and for most of the records, I do see the decimal
places in my combined field. However, whenever the fields are equal to ".00",
I don't carry a decimal value in my combined field. What options do I have?
Here are my fields:

field 1: ${mergefield "sal1"\#0.00}
field 2: ${mergefield "sal2"\#0.00}
combinded field: ${={mergefield sal1\#0.00} +{mergefield sal2\#0.00}

Many thanks for any help.

--
Don't wait for your answer, click here: http://www.word.mvps.org/

Please reply in the group. Please do NOT email me unless I ask you to.

John McGhie, Consultant Technical Writer
+61 4 1209 1410, mailto:[email protected]
McGhie Information Engineering Pty Ltd
http://jgmcghie.fastmail.com.au/
Sydney, Australia. S33°53'34.20 E151°14'54.50
 
P

Peter Jamieson

I think the problem is that you need to apply the formatting switch to the
result of the = field, not to the individual components of the calculation,
i.e.

instead of

{={mergefield sal1\#0.00} +{mergefield sal2\#0.00} }

try

{={mergefield sal1} +{mergefield sal2} \#0.00 }
 
G

Graham Mayor

Or even {={mergefield sal1} + {mergefield sal2} \# "0.00;;0" }

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top