Prevent Adobe Acrobat from Rounding PDF Commission Amounts
Question details
Keep a fillable PDF commission calculation from rounding a $75.50 result to $76.00.

- Product
- Adobe Acrobat PDF form JavaScript
- Device & OS
- not provided
- Scenario
- A commission field calculates an amount from a fixed value or a percentage of a monthly amount.
- Observed behavior
- The calculation returns $76.00 instead of $75.50 even though the fields display two decimal places.
Open the PDF in Adobe Acrobat and locate the COMMISSION9, FIXED9, PERCENT9, and MRC9 form fields. Note their current values and check whether MRC9 has its own calculation script.
Remove whole-dollar rounding from the commission calculation
Use this solution when Math.round is rounding the calculated commission before the field displays it.
JavaScript's Math.round accepts one argument and rounds to a whole number. The second argument in Math.round(value, 2) does not make it round to two decimal places.
The following script preserves the calculated value and lets the field's display format show two decimal places. It retains the existing rule that a positive FIXED9 value takes precedence.
In Acrobat, open the PDF and choose Prepare a form. Open the properties for the COMMISSION9 field.
On the Calculate tab, select Custom calculation script and choose Edit. Replace the existing calculation with: var fixed = Number(this.getField('FIXED9').value); var percent = Number(this.getField('PERCENT9').value); var mrc = Number(this.getField('MRC9').value); event.value = fixed > 0 ? fixed : (percent / 100) * mrc;
In COMMISSION9 Properties, open the Format tab, select Number, set Decimal Places to 2, and choose the currency symbol.
Close the field properties and preview or use the form. For example, enter 0 in FIXED9, 10 in PERCENT9, and 755 in MRC9; COMMISSION9 should display $75.50.

Check the source values and calculation order
Use this check if the result is still incorrect after removing Math.round from COMMISSION9.
Work with PDF and Office files in WPS Office
WPS Office is a free, lightweight alternative with a familiar interface and support for common Office formats, making it easy to move existing documents into your workflow. Its PDF tools can help with everyday PDF tasks, but correcting this Acrobat JavaScript calculation requires Adobe Acrobat.

Frequently Asked Questions
Why does Math.round(value, 2) return a whole dollar amount?
JavaScript ignores the second argument to Math.round, so it rounds the first argument to a whole number. Remove Math.round from the commission calculation if you want to preserve the calculated cents.
Where do I set the commission field to show cents?
In Acrobat, choose Prepare a form, open COMMISSION9 Properties, and use the Format tab to select Number with two decimal places and a currency symbol.
Why does the percentage calculation seem to be ignored?
The script uses FIXED9 whenever its value is greater than zero. Enter 0 in FIXED9 when testing the percentage calculation.
What if MRC9 is already rounded before the commission is calculated?
Open MRC9 Properties in Prepare a form and inspect its Calculate tab. Check its script and the form's field calculation order so MRC9 is calculated correctly before COMMISSION9.




