Format PDF Form Percentages to Two Decimal Places in Adobe Acrobat
Question details
Display a numeric PDF form value as a percentage with exactly two decimal places.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- A PDF form field needs to display an entered value such as 8 as 8.00%.
- Observed behavior
- The desired format adds two decimal places and a percent sign without multiplying the entered value.
Open the PDF in Adobe Acrobat with access to the Prepare a form tool. Identify the numeric text field you want to format and confirm that users will enter numbers without a percent sign.
Add a custom percentage format script in Acrobat
Use a custom field format to display an entered number with two decimal places and a percent sign.
This script treats the entered number as the percentage value: 8 displays as 8.00%. It does not multiply the value by 100.
In Acrobat, open the PDF and select All tools > Prepare a form.
Double-click the text field you want to format, then select the Format tab in its properties.
Under Select format category, choose Custom, then click Edit next to Custom Format Script.
In the JavaScript editor, enter: var x = Number(event.value); if (event.value) event.value = x.toFixed(2) + "%"; Then click OK and close the field properties.
Exit form editing or select Preview, enter 8 in the field, and move to another field. The value should display as 8.00%. Save the PDF.

Work with PDF and Office files in WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for working with PDF and Office documents. Its format compatibility helps make the move from Microsoft Office straightforward; use Adobe Acrobat for the custom PDF form JavaScript described above.

Frequently Asked Questions
Where do I add the percentage script in Acrobat?
Open All tools > Prepare a form, double-click the field, and select Format > Custom. Click Edit next to Custom Format Script and paste the script there.
Will entering 0.08 display 8.00%?
No. The script adds decimal places and a percent sign without multiplying by 100, so 0.08 displays as 0.08%. Enter 8 to display 8.00%.
Why does the field show NaN%?
The value may contain text or a percent sign that Number() cannot convert. Enter a number such as 8 without the percent sign, then move to another field.
Can I add this script in Acrobat Reader?
Adding a custom form field script requires Acrobat with access to form editing. Open the PDF in Acrobat and use Prepare a form to edit the field properties.




