# Thread: Mail Merge Currency, cents only without dot

1. ## Mail Merge Currency, cents only without dot

I have a mail merge that i want to get the cents only. but i cant use /.00 because then i get a dot. How can we get it without the dot?

2. I don't know what your source is but you can multiply the number by 100 then take the modulo of the answer divided by 100 should get you an integer from 0 to 99.

On second thought I guess you could just take the modulo of the number divided by 1!

3. I am talking about a mail merge field. I dont control the actual data. So lets assume the field name is MyAmount. and the row is 2.45. What i want is to right only 45.

How do i get only the 45 to display.

4. If the merge field name is Value1, try field codes: { mod(Value1,1) * 100 }

5. Thanks. This is what i used in the end for anyone interested.

{MERGEFIELD KP \* CardText \* FirstCap} Dollars and = {={MERGEFIELD KP \# ".00" } *100 \* MERGEFORMAT \* CardText \* FirstCap } Cents

And this is the result.

Fifty-two Dollars and twenty Cents

6. Hi Shragel,

You don't need the '\* MERGEFORMAT' switch. And, in case, you're interested, here's a more sophisticated version of the code, that adds the 's' on 'dollar' and 'cent' only where warranted:
{QUOTE {SET Val {MERGEFIELD KP}"{=INT(Val) \* CardText} dollar{=INT(Val)-1 \# "s;s;"}{IF{=MOD(Val,1) \# 0.00}> 0 " and {=MOD(Val,1)*100 \# 0 \* CardText} cent{=INT(MOD(Val,1)*100-1) \# "s;s;"}"}" \* FirstCap}

One thing you'll note is that the \* CardText switch doesn't insert 'and' where it's used in such strings outside the US (eg "One hundred and one dollars"). If you need that, I can provide an even more sophisticated version.

7. ## The Following User Says Thank You to macropod For This Useful Post:

RetiredGeek (2011-05-27)

8. Thanks. You are great.