PDF Editing Issues

How to Format PDF Form Numbers with a Measurement Suffix

John WilsonJohn Wilson Oct 28, 2026 868 views

Question details

The user needs to format a numeric PDF form field to display two decimal places followed by a measurement suffix (such as 99.00mm) while ensuring the field prompts a numeric keypad on an iPad.

How to Format PDF Form Numbers with a Measurement Suffix
Product
PDF
Device & OS
iPad
Scenario
Creating a fillable PDF form where users input a number of varying digit lengths, and the form automatically appends a unit of measurement without breaking underlying numeric validations.
Observed behavior
Using arbitrary input masks fails because the inputted values have varying lengths. Adding the suffix as text directly into the field prevents accurate numeric validation and calculation.
Before you start

Verify that your PDF editing software allows you to access and modify field properties, specifically the ability to add custom JavaScript format and validation scripts to text fields.

Solution 1Recommended

Use a Custom Format Script for the Suffix

Apply a custom JavaScript format script to change how the number is displayed by appending the suffix, while keeping the underlying value strictly numeric for calculations and mobile keypad compatibility.

By separating the display format from the actual inputted value, the PDF continues to treat the input as a number. This allows mathematical calculations to function correctly and ensures the numeric keypad appears on mobile devices like the iPad.

1
Access Field Properties

Open your PDF form editor, switch to the Form editing mode, right-click the specific numeric text field, and select Properties.

2
Navigate to the Format Tab

In the Properties dialog box, click on the 'Format' tab to adjust how the data is displayed.

3
Apply Custom JavaScript

Select 'Custom' from the Select Format Category dropdown list. In the Custom Format Script box, enter a script such as: if (event.value !== '') { event.value = util.printf('%.2f', event.value) + 'mm'; }

4
Set Validation to Numeric

Ensure the underlying value remains a number by navigating to the 'Validate' tab (or using the Keystroke script) and restricting inputs to numbers only. Save the PDF.

Use a Custom Format Script for the Suffix
Mobile Viewer Limitations: Always test the formatted field in the target mobile viewer (such as Acrobat for iPad), as JavaScript support and custom display formats can vary significantly across different iOS PDF reader applications.
Advanced PDF Form Editing

Easily Create and Edit PDF Forms with WPS Office

WPS Office offers comprehensive PDF form creation and editing tools. You can easily manage text fields, apply precise numeric formatting, and ensure your forms function seamlessly across different devices.

  1. 1. Open Your PDF Form: Launch WPS Office and open your PDF document containing the interactive forms.
  2. 2. Access Form Tools: Navigate to the 'Form' tab on the top ribbon to access all interactive field tools.
  3. 3. Edit Field Properties: Double-click or right-click any text field to open its properties, where you can modify formats, validations, and appearance settings.
Easily insert, edit, and format interactive PDF form fields.High compatibility with Adobe PDF forms and Microsoft Office document formats (Word, Excel, PowerPoint).Lightweight application with an intuitive, user-friendly interface.
microsoft office alternative - wps office

Frequently Asked Questions

Why does adding a measurement unit directly to my PDF field break my calculations?

When text characters like 'mm' are concatenated directly into the field's actual value, the PDF reader treats the entire entry as a text string rather than a number. This breaks any mathematical calculations linked to that field. You must use a display format script so the true underlying value remains strictly numeric.

Will custom JavaScript formatting work on my iPad?

JavaScript support depends entirely on the PDF viewer app used on the iPad. The official Adobe Acrobat mobile app supports most form scripts, but the default built-in iOS viewers (like Preview or Files) often have limited or no JavaScript support. It is highly recommended to test your form on the specific app your audience will use.

How do I force the numeric keypad to appear on mobile PDF forms?

To trigger the numeric keypad on a mobile device, the PDF field's format category must be explicitly set to 'Number', or the field's underlying validation must restrict input to numbers only. If the field allows arbitrary text, the standard alphanumeric keyboard will display.