PDF Editing Issues

Acrobat Form Calculation: Add 0.05 and Cap a Field

Ayan MasoodAyan Masood Nov 19, 2026 868 views

Question details

Calculate field C by adding 0.05 to field A, limiting the result to 0.1795, and leaving C blank when A is empty.

Add 0.05 and Cap a Calculated Field in Acrobat
Product
Adobe Acrobat
Device & OS
not provided
Scenario
A PDF form needs a calculated field with an upper limit and a blank result for an empty input.
Observed behavior
Field C should show the calculated value up to 0.1795 and remain blank when field A has no value.
Before you start

Open the form in an Acrobat version that can edit PDF forms. Check that the input field is named A and the calculated field is named C, or adjust the field name in the script.

Solution 1Recommended

Add a custom calculation script to field C

Use this method to calculate and cap the value automatically in an interactive Acrobat PDF form.

1
Open the form editor

In Acrobat, open the PDF and select Prepare a Form from the tools menu.

2
Open field C properties

Double-click field C and select the Calculate tab. Confirm that the input field is named A.

3
Enter the calculation

Select Custom calculation script, click Edit, and enter: var input = this.getField("A").valueAsString; if (input.replace(/\s/g, "") === "") { event.value = ""; } else { var n = Number(input); event.value = isFinite(n) ? Math.min(n + 0.05, 0.1795) : ""; }

4
Save and test the form

Confirm the script, close the field properties, and save the PDF. Enter 0.1 in A to check that C shows 0.15; enter 0.2 to check the cap, then clear A to check that C becomes blank. Also test 0 in A.

Add a custom calculation script to field C
Check the displayed precision: If C does not display 0.1795 exactly, open its Properties, select Format, and check the number format and decimal places. The script expects numeric input; nonnumeric input leaves C blank.
Calculate in WPS Spreadsheets

Calculate the same capped value in WPS Spreadsheets

Use a formula in WPS Spreadsheets to add 0.05, apply the cap, and leave the result blank for an empty input. You can export the result to PDF, but the exported PDF is not an interactive Acrobat form calculation.

  1. 1. Open a spreadsheet: Open WPS Spreadsheets and create a blank workbook or open an existing one.
  2. 2. Enter the formula: Select cell C1 and enter =IF(A1="","",MIN(A1+0.05,0.1795)).
  3. 3. Test the calculation: Enter a number in A1 and check C1. Clear A1 to confirm that C1 appears blank.
  4. 4. Export if needed: Use the PDF export option in the File menu to create a PDF showing the current result.
Calculate a capped result without writing a PDF form scriptLeave the result blank when the input cell is emptyOpen and save Microsoft Excel XLSX filesExport calculated results to PDF
microsoft office alternative - wps office

Frequently Asked Questions

Where do I put the Acrobat calculation script?

Open Prepare a Form, double-click field C, and choose Calculate > Custom calculation script > Edit.

Does an input of zero leave field C blank?

No. The script checks for an empty value separately, so entering 0 in A produces 0.05 in C.

Why does the capped value display with fewer than four decimal places?

Open field C's Properties and check the Format tab. Adjust the number format and decimal places so that 0.1795 can be displayed.

Will a PDF exported from WPS Spreadsheets recalculate when someone edits it?

No. The exported PDF shows the spreadsheet result at export time; it does not contain the Acrobat custom calculation script.