Solved

Rounding Up in Acrobat javascript

Posted on 2004-09-09
1
1,066 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
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Update 21-May-2015: I temporarily removed the source code and the code snippets to make major changes to the program. Regards, Joe INTRODUCTION This Article is a follow-up to the Article entitled How To Rename-Move a Batch of PDF Files Based o…
This article focuses on how to remove password security from multiple PDF files by Adobe Acrobat program. Sometimes it is essential to access the stored data items and to print, edit as well as copy content from Portable Document Format files in abs…
In this second video of the Xpdf series, we discuss and demonstrate the PDFimages utility, which, in a single command, is able to extract all the images from a PDF file and save each one in a separate image file (PBM, PPM, or JPG). Download and inst…
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now