Converting the numeric digits to text automatically

  • Thread starter Rahul Srivastava
  • Start date
R

Rahul Srivastava

Hi

How can i automatically change the digits value in text value . Like if a
input is provide in word thru mail merge as Total value 2000$ that i want to
automatically have it coverted in text in another place in the same document
as "Two thousand" dollars.

Kindly help me in providing the answer .
 
P

Peter Jamieson

If you have a mergefield called amount containing (say) 2000 you can use

{ MERGEFIELD amount \*cardtext }

to produce

"two thousand"

If amount actually contains "2000$","$2000", "$2,000.00" etc. the result
should be the same, i.e. you need to add the text "dollars" yourself.

For larger numbers cardtext produces what I believe is the American English
version of the number, e.g.

1234 is "one thousand two hundred thirty-four"whereas e.g. in British
English it would typically be "one thousand two hundred and thirty-four"

For really large numbers you might have to do a bit more.

Another switch, \*dollartext, turns 1234.56 into "one thousand two hundred
thirty-four and 56/100"

Peter Jamieson
 

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