
1. Re: Trying to multiply two cells, then round the result.
George_Johnson Feb 10, 2016 4:06 PM (in response to johnr84070315)Try something like:
// Custom calculation script
(function () {
// Get the field values, as numbers
var v1 = +getField("Line4").value;
var v2 = +getField("Line5").value;
// Multiply the values
var result = v1 * v2;
// Set the value of this field, rounding to two decimal places
event.value = util.printf("%.2f", result);
})();
More information in the util.printf method is in the Acrobat JavaScript reference. This could be simplified a bit, but it should be clear. If either of the input fields is blank, the result will be 0.00, but you could add additional code if you want the field to be blank.

2. Re: Trying to multiply two cells, then round the result.
johnr84070315 Feb 10, 2016 4:15 PM (in response to George_Johnson)That worked as expected! Thanks George!
John

3. Re: Trying to multiply two cells, then round the result.
gkaiseril Feb 11, 2016 11:26 AM (in response to johnr84070315)If the input values for the calculation are coming from a field being calculated from other fields, you may be getting the error due to an accumulated rounding error because the other fields' values are not the rounded value but the unrounded value of the calculations. You may need to force the results of your calculations to be the rounded value and not the raw values. This is especially true with tax forms or bills of sales.

4. Re: Trying to multiply two cells, then round the result.
johnr84070315 Feb 11, 2016 11:36 AM (in response to gkaiseril)How would I go about forcing that rounding? I assume adding a rounding script to all the fields my final calculation field is pulling from?