These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Conversion of numbers to words

ramdoss
Registered: Feb 16 2009
Posts: 8
Answered

There is a sample script in Adobe CD - check.pdf which converts the number format of currency into words and it works fine for American dollars. Can somebody help to alter this script which will convert to indian rupees?

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Please explain more of what you want. What do you mean by it converts currency into words?

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

ramdoss
Registered: Feb 16 2009
Posts: 8
Thank you for the immediate response. The document contains two fields - when the user inputs the value in the first field, say 1200 and presses the TAB, the second field (calculated field) shows the value as One Thousand and Two Hundred Dollars. This script has values of "Thousand", "Million",
"Billion", "Trillion", "Quadrillion". But in Indian system after Thousands, there are only two values i.e Lakhs and Crores.

100 Thousands = 1 lakh
100 lakhs = 1 Crore

After Crores, everything will be expressed as Thousands of crores or Lakhs of crores.

Can you pl guide.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
There are a couple of ways to go about this conversion. But basically you are just looking for certain progressive multipliers. If you have the script, all you need to do is replace the multipliers and text used in the script with the ones you need.

I imagine that the script is quite a few lines long, but that it looks very repetitive. Look through it and find the locations were "Million" and "Billion" are used. These are your replacements for "lakh" and "crore". Be sure to replace the mulitpliers used in the calculation as well.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script