Solved

Rounding Up in Acrobat javascript

Posted on 2004-09-09
1
1,108 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in 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…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

705 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