PDF Editing Issues

Display Only Decimal Digits in an Adobe Acrobat Form Field

Aamir Naveed AkramAamir Naveed Akram Nov 19, 2026 869 views

Question details

The user wants an Acrobat form field to display only the digits after the decimal point.

Display Only Decimal Digits in an Adobe Acrobat Form Field
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.
Before you start

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.

Solution 1Recommended

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.

1
Open the form editor

Open the PDF in Adobe Acrobat and select All tools > Prepare a form, or Tools > Prepare Form in older versions.

2
Open field properties

Double-click the field that contains the decimal value, then select the Format tab in its Properties dialog.

3
Add the format script

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];

4
Test and save

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.

Use a Custom Format Script in the Acrobat Form Field
Display versus stored value: A custom format script changes the field's display, not its underlying value. If the decimal digits must become the actual stored value, a different calculation or validation approach is needed.
Free Microsoft Office alternative

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.

Open and work with PDFs alongside your other documentsCompatible with Microsoft Office formats including DOCX, XLSX, and PPTXFamiliar document, spreadsheet, and presentation toolsFree and lightweight for everyday office work
microsoft office alternative - wps office

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.