Solved

Rounding Up in Acrobat javascript

Posted on 2004-09-09
1
1,081 Views
Last Modified: 2008-01-16
Is there an equivalent of math.ceil to round up a number in Acrobat javascript?

I am multiplying .0212 by 5200, which produces 110.24

I want the result displayed in the textbox as a rounded-up whole number: 111

How would this be expressed?

Ordinarily these two numbers are variables in javascript code.

On the format tab in Text Field properties, would you set the number for 2 decimal places, so as to have something for the rounding to work on?

Thank you for your help.
0
Comment
Question by:goodmorals
1 Comment
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 250 total points
ID: 12021655
You would use the Math.ceil() function for this. Let's assume you have two variables v1 and v2 that you want to multiply, and a variable r (for result or rounded) that will store the rounded up value:

r = Math.ceil(v1 * v2);

0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the questions I get asked again and again is how to validate a field value in an AcroForm with a custom validation script. Adobe provided a lot of infrastructure to do that with just a simple script. Let’s take a look at how to do that wit…
Update 21-May-2015: I temporarily removed the source code to make major changes to the program. Regards, Joe In a previous Experts Exchange article, How To Rename-Move a Batch of PDF Files Based on Contents of the Files (http://www.experts-exchan…
In this third video of the Xpdf series, we discuss and demonstrate the PDFtoText utility, which converts PDF files into plain text files. Download and install the software.: You may have already downloaded and installed the Xpdf tools while watching…
We often encounter PDF files that are pure images, that is, they do not have text characters, but instead contain only raster graphics. The most common causes of this are document scanning software and faxing software/services that create image-only…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question