1 Reply Latest reply on Aug 16, 2015 9:44 AM by gkaiseril

Need help with rounding...

Hello,

I am working on a fillable form in Acrobat XI.  I have been able to figure out how to make some fields auto-calculate using simplified field notation.  However, I do not have much experience with this or javascript.

What I need is for a field to round up to the next 0.25 when doing its calculation.  Currently, I have simplified field notation taking a field that shows the sum of two fields and dividing by 60.

totalpca / 60

A response to this equation may be something like 15.55.  However, what I need it to read is 15.75.  (Because it rounded up to the next 0.25)  My numbers should all end in .00, .25, .50, or .75, with it always rounding up.  I am pretty sure, if this is possible, it would need to be done with javascript, but I don't even know where to begin.

• 1. Re: Need help with rounding...

Do you know how to do this with paper an pencil?

1. Compute the number of  whole 25 units in the value.

2. Change the value to the next larger integer.

3. Convert the number of 25 units back to a decimal number.

// field names as variables for processing;
var cField1 = "Text1";
var cField2 = "Text2";