How to Show Decimal Places in PDF Form Percentage Fields in Acrobat
Question details
The user needs to modify a PDF form field to display exact decimal places instead of automatically rounding percentage values to the nearest integer.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Setting up or editing text fields in a PDF form to accurately calculate and display percentage values with decimals.
- Observed behavior
- Adobe Acrobat automatically rounds percentage values in the form field to integers due to its default scripting, preventing the display of decimals.
Ensure you have permission to edit the PDF document and access to a PDF editor with form editing capabilities enabled. It is recommended to save a copy of your document before modifying formatting scripts.
Modify the Custom Format Script in Form Properties
Adjust the JavaScript format code within the text field properties to declare the exact number of decimal places you want to display.
PDF form fields often utilize custom scripts for complex formatting. If a percentage field is automatically hiding decimals, its format script is likely instructed to output zero decimal places using a '%.0f' format string. Changing this value allows for precise decimal representation.
Open your PDF document in Adobe Acrobat, navigate to the Tools menu, and select 'Prepare Form' to enable form field editing.
Locate the percentage field that is incorrectly rounding numbers. Right-click on it and select 'Properties' from the context menu.
In the Properties dialog box, click on the 'Format' tab. Ensure the 'Select format category' dropdown is currently set to 'Custom'.
Find the 'Custom Format Script' text box. Look for a line of JavaScript resembling: event.value = util.printf("%.0f%%", event.value);. The '0' indicates that zero decimal places are rendered.
Modify the '0' to specify your desired decimal precision. For example, change it to "%.1f%%" for one decimal place (e.g., 8.5%) or "%.2f%%" for two. Click 'OK' to save the properties and exit the editing mode.

Create and Manage PDF Forms Easily with WPS Office
WPS Office features a robust and lightweight built-in PDF editor that enables you to fill out, design, and manage interactive PDF form fields seamlessly, bridging your productivity across multiple document formats.
- 1. Download WPS Office: Visit the official WPS Office website to download and install the free multi-platform suite.
- 2. Open Your PDF File: Launch WPS Office and use the 'Open' button to import your PDF document into the WPS PDF module.
- 3. Navigate to Form Tools: Select the 'Form' tab on the top toolbar to access all interactive PDF form creation and formatting utilities.
- 4. Edit Field Properties: Double-click any customizable form field to open the properties panel and adjust its data format precisely.

Frequently Asked Questions
Why does my PDF form field automatically round to a whole number?
This rounding occurs because the field's formatting parameter is either defaulting to the integer format or explicitly scripted to zero decimal places using a script like '%.0f'. Updating the formatting settings or editing this script resolves the issue.
Can I set different decmial places for different fields in a PDF form?
Yes, PDF form field properties operate independently. You can apply different formatting categories or custom scripts to individual fields by opening their properties one at a time.
Do I need to write JavaScript from scratch to align decimals in PDF forms?
No, writing code from scratch is generally unnecessary. You can often use the standard 'Percentage' or 'Number' format category to define decimal places. If a custom script is already in place, you only need to modify the decimal indicator number within the existing util.printf function.




