How to Convert a Numeric PDF Form Field Amount into Words
Question details
The user needs a destination PDF form field to automatically convert and display a numeric amount from another field as written words.

- Product
- PDF Editor
- Device & OS
- not provided
- Scenario
- Creating an interactive financial PDF form, such as an invoice or contract, where numeric amounts need to be spelled out automatically.
- Observed behavior
- Standard PDF form formatting lacks a built-in number-to-words conversion, requiring a custom JavaScript calculation.
Ensure you are using a professional PDF editor that supports document-level JavaScript and custom field calculations. Make sure both your numeric input field and text output field are properly created and named before adding the script.
Use a Custom JavaScript Calculation Script
Add a document-level JavaScript function to handle the conversion, then call it from the destination field's calculation properties.
Because standard PDF form properties do not include a number-to-words format, you must use a user-defined JavaScript function. You will first define the logic at the document level, and then trigger it from the specific text field where the spelled-out words should appear.
Add two text fields to your PDF document. Name the first one 'AmountNumber' (for user input) and the second one 'AmountWords' (to display the result).
Open your PDF editor's JavaScript menu (e.g., 'Document JavaScripts') and create a new script. Paste a standard number-to-words JavaScript function (easily found through a quick web search) and save it. Name the function something recognizable like 'convertNumToWords'.
Right-click the 'AmountWords' field and select 'Properties'. Go to the 'Calculate' tab, choose 'Custom calculation script', and click 'Edit'. Enter the script: 'event.value = convertNumToWords(this.getField("AmountNumber").value);'.
Close the form editing mode and type a number into the 'AmountNumber' field. Press Enter or click outside the field; the 'AmountWords' field should automatically update to show the spelled-out words.

Create Interactive PDF Forms with WPS Office
WPS Office includes a comprehensive PDF editor that allows you to seamlessly create form fields, edit properties, and manage interactive documents for your business needs.
- 1. Open your PDF: Launch WPS Office and open your existing PDF document.
- 2. Access the Form tools: Navigate to the 'Form' tab on the top ribbon to view all available form controls.
- 3. Add form fields: Select the 'Text Field' tool and draw the required input areas on your document.
- 4. Edit field properties: Double-click any field to adjust its name, appearance, formatting, and interactive behavior.

Frequently Asked Questions
Can I convert numbers to words in a PDF without using JavaScript?
No, standard PDF specifications do not include a built-in formatting option to spell out numeric values. A custom calculation script is explicitly required to achieve this.
Why is my PDF form calculation not updating automatically?
Check your PDF viewer's preferences to ensure 'Enable Acrobat JavaScript' or 'Enable Interactive Form Fields' is turned on. Also, verify that the source field's name exactly matches the one referenced in your custom script.
Where can I find the JavaScript code for number-to-words conversion?
You can find many free, open-source JavaScript functions for converting numbers to words on developer forums like Stack Overflow or Adobe Support Community. Copy the function and paste it into your document's JavaScript editor.




