I created a pdf form that mulitiplies s.t. hours (5.5) in one column x rate per hour (29.15) in the second column. I have the result in a third column formatted for 2 decimal places. The result shows as 160.33 on the form; calculates to 160.325. Then I multiply the result (160.33) x an overhead percentage in another spot on the form (.55%) with a result of (88.18). My subtotal value of the 160.33 plus the overhead amount of 88.18 shows as 248.50. Is there a script that will round the subtotal so it shows 248.51? I'm new at this so any help you can give me would be appreciated.
Looks like this:
Hours Rate Dollar Amount Labor OH 55% Sub-Total
5.5 29.15 160.33 88.18 248.50
If you want the actual values of the fields to be rounded you'll have to do some more work, this is not a feature that is built into Acrobat. One of the simplest ways to do this is to add the following code to the Validation event of the calculated fields:
event.value = util.printf("%02.2f",event.value);
This code is for an AcroForm, which from your post is what I believe you are using.
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]
Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script