Display Only Decimal Digits in an Adobe Acrobat Form Field
Question details
The user wants an Acrobat form field to display only the digits after the decimal point.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- A form field contains a value such as 1.23, and the desired display is 23 in the same field.
- Observed behavior
- The desired result is to show the decimal digits while distinguishing display formatting from changing the stored field value.
Open the PDF in a version of Adobe Acrobat that can edit form fields, and identify the field containing the decimal value. The script below expects a period as the decimal separator.
Use a Custom Format Script in the Acrobat Form Field
Use this method to display the digits after the decimal point in the same field while retaining the underlying value.
Open the PDF in Adobe Acrobat and select All tools > Prepare a form, or Tools > Prepare Form in older versions.
Double-click the field that contains the decimal value, then select the Format tab in its Properties dialog.
Choose Custom from the format category menu, select Edit under Custom Format Script, and enter: var str = String(event.value); var parts = str.split('.'); if (event.value && parts.length > 1) event.value = parts[1];
Confirm the script, close the Properties dialog, and use Preview to enter a value such as 1.23. Check that the field displays 23, then save the PDF.

Work With PDFs and Office Files in WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for viewing and editing documents and working with PDFs. Its Microsoft Office format compatibility makes moving existing files straightforward; it does not fix or replace Acrobat's custom form-format scripts.

Frequently Asked Questions
Does the script change the value stored in the field?
No. A Custom Format Script controls how the value is displayed. The underlying value remains available for form calculations and other uses.
What happens if the value has no decimal point?
The script leaves the display unchanged when it does not find a period. For example, a value of 12 remains displayed as 12.
Will the script work with a comma as the decimal separator?
Not as written. The script splits the value at a period. If your form uses a comma, adjust the separator in the script and test it with the values your form receives.
Can the field display leading zeros after the decimal point?
The script displays the characters after the period, including leading zeros, if they are present in the value passed to the format script. Test your field's input and calculation settings to confirm those characters are retained.




