how to make wording of amounts for cheque print

H

habib unilog

I want to transform an amount in figures to an amount in words to print cheque
 
J

Jay Freedman

habib said:
I want to transform an amount in figures to an amount in words to
print cheque

Use a field with the \*DollarText or \*CardText formatting switch, not VBA.
See http://www.gmayor.com/formatting_word_fields.htm, in the section titled
"Formatting cash amounts in words".

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
M

macropod

Alternatively, if you want to be able to:
1. handle more than the \*DollarText or \*CardText limit (999,999.99);
2. use currencies other than dollars; and
3. have the output in UK/Aus English,
you could use a field coded along the lines of:
{QUOTE {IF{=INT(Val/100000000)}<> 0 "{=INT(Val/100000000) \*Cardtext} hundred "}
{IF{=MOD(INT(Val/1000000),100)} <> 0 "{IF{=INT(Val/100000000)}<> 0 "and "}"}
{IF{=INT(Val/1000000)}<> 0 "{=MOD(INT(Val/1000000),100) \*Cardtext} million, "}
{IF{=INT(Val/100000)}<> 0 "{=MOD(INT(Val/100000),10) \*Cardtext} hundred "}
{IF{=MOD(INT(Val1000),100)} <> 0 "{IF{=INT(Val/100000)}<> 0 "and "}"}
{IF{=INT(Val/1000)}<> 0 "{=MOD(INT(Val/1000),100) \*Cardtext} thousand, "}
{IF{=MOD(INT(Val/100),10)}<> 0 "{=MOD(INT(Val/100),10) \*Cardtext} hundred "}
{IF{=MOD(INT(Val),100)}<> 0 "{IF{=INT(Val/100)}<> 0 "and "}{=MOD(INT(Val),100) \*Cardtext} "}
{=INT(Val) \# \pound;;}{IF{=INT(Val)}> 1 "s"}
{IF{=MOD(Val,1)}<> 0 "{IF{=INT(AbsVal)}<> 0 " and "}{=MOD(Val,1)*100 \*Cardtext} {IF{=MOD(Val,1)}> 0.01 pence penny}"} \* FirstCap}

The above field is coded for UK currency and will let you go as high as 999,999,999.99, returning "Nine hundred and ninety-nine
million, nine hundred and ninety-nine thousand, nine hundred and ninety-nine pounds and ninety-nine pence". Actually, you can go
higher still (eg 99,999,999,999.99) but the text expression for the higher orders of magnitude aren't quite right - a bit more code
could be introduced for that - but only if it was really needed.
 

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