Solved

Rounding Up in Acrobat javascript

Posted on 2004-09-09
1
1,090 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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Getting information about Fonts being used in a PDF file A colleague of mine recently faced an issue related to the PDF file format. The PDFs were containing mission critical client information, they were successfully mailed but there was a sm…
PaperPort is a popular document imaging/management product from Nuance Communications (http://www.nuance.com/). It is in widespread use by both individuals (http://www.nuance.com/for-individuals/by-product/paperport/index.htm) and businesses (http:/…
Sometimes we receive PDF files that are in the wrong orientation. They may be sideways or even upside down. This most commonly happens with scanned or faxed documents. It is possible to rotate the view of these PDFs with the free Adobe Reader produc…
In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

820 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