How to Format Thousands Separators as Spaces in PDF Forms
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.

- 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.
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.
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.
Open your PDF form in your PDF editor and enter the Form Editing mode to reveal all interactive fields.
Right-click the target text field where you enter numbers and select 'Properties' from the context menu.
In the Properties dialog box, click on the 'Format' tab. From the 'Select format category' drop-down list, choose 'Custom'.
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.
Repeat this process for any calculated result fields linked to this input, ensuring both input and output fields share the same custom formatting.

Change Locale Number Format (If Supported)
If your PDF editor or operating system locale supports spaces as a thousands separator by default, you can select it directly from standard number formats.
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. Open the PDF: Launch WPS Office and open your interactive PDF document.
- 2. Access Form Tools: Navigate to the 'Form' tab on the top ribbon to reveal form editing and configuration tools.
- 3. Modify Text Fields: Double-click an existing text field or click 'Text Field' to add a new one, opening the properties panel.
- 4. Adjust Formatting: Use the properties menu to adjust standard number formats or apply custom scripts for precise control over data display.

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.




