PDF Editing Issues

How to Format Thousands Separators as Spaces in PDF Forms

Phi Hung VoPhi Hung Vo Nov 5, 2026 870 views

Question details

The user wants to format numbers in a PDF form to display spaces as thousands separators instead of the standard commas or periods.

How to Display Thousands Separators as Spaces in PDF Forms
Product
PDF Editor
Device & OS
not provided
Scenario
Setting up form field properties for interactive PDF forms to customize how calculated and user-entered numbers are visually formatted.
Observed behavior
By default, numbers use standard locale separators like commas (e.g., 23,444). The user requires a specific visual format utilizing spaces (e.g., 23 444) without breaking underlying calculations.
Before you start

Ensure your PDF form fields are correctly configured as Text Fields and that you have access to the field properties menu in your PDF editor.

Solution 1Recommended

Use Custom JavaScript for Number Formatting

Apply a custom JavaScript format script to the text field properties to automatically insert spaces between groups of three digits while maintaining calculation integrity.

Standard number formatting options in PDF editors typically rely on the system's locale settings, which may only offer commas or decimals. To enforce a space as a thousands separator universally, you need to use a custom format script.

This script alters the display value of the field without permanently converting the underlying mathematical value into text, allowing calculation fields to continue functioning properly.

1
Open Form Editing Mode

Open your PDF form in your PDF editor and enter the Form Editing mode to reveal all interactive fields.

2
Access Field Properties

Right-click the target text field where you enter numbers and select 'Properties' from the context menu.

3
Navigate to the Format Tab

In the Properties dialog box, click on the 'Format' tab. From the 'Select format category' drop-down list, choose 'Custom'.

4
Enter the Formatting Script

In the Custom Format Script window, input the necessary JavaScript code that formats numeric input with space separators (e.g., using regular expressions to insert spaces). Click 'OK' or 'Close' to save.

5
Apply to Result Fields

Repeat this process for any calculated result fields linked to this input, ensuring both input and output fields share the same custom formatting.

Use Custom JavaScript for Number Formatting
Calculation Warning: Always apply custom formatting to the 'Format' tab rather than the 'Calculate' tab to ensure the underlying numeric value remains suitable for mathematical calculations.
Advanced PDF Form Editing

Edit and Format Interactive PDF Forms with WPS Office

WPS PDF provides comprehensive form editing tools, allowing you to create interactive forms, configure text fields, and manage custom formatting easily without the need for complex software.

  1. 1. Open the PDF: Launch WPS Office and open your interactive PDF document.
  2. 2. Access Form Tools: Navigate to the 'Form' tab on the top ribbon to reveal form editing and configuration tools.
  3. 3. Modify Text Fields: Double-click an existing text field or click 'Text Field' to add a new one, opening the properties panel.
  4. 4. Adjust Formatting: Use the properties menu to adjust standard number formats or apply custom scripts for precise control over data display.
Easily create, fill, and edit interactive PDF formsConfigure custom text field properties and number formattingSeamlessly compatible with Adobe Acrobat PDF formsLightweight, fast, and features a user-friendly interface
microsoft office alternative - wps office

Frequently Asked Questions

Why does my calculation break when I format numbers with spaces?

If spaces are hard-coded into the actual field value (turning the number into a text string) rather than applied purely as a display format, calculation scripts will fail to recognize the value as a mathematical number. Always apply formatting using the display formatting options or dedicated format scripts.

Can I apply custom formatting to multiple fields at once?

Yes. While in Form Editing mode, you can select multiple text fields simultaneously by holding down the Ctrl key, right-click to open their combined properties, and apply the same format category or custom script to all selected fields at once.

How do I remove custom formatting from a PDF form field?

Open the specific field's properties, go to the Format tab, and change the format category from 'Custom' back to 'None'. This will clear the script and return the field to its default unformatted state.