Skip to main content
Participant
January 13, 2025
Question

Adobe Form Fields

  • January 13, 2025
  • 2 replies
  • 266 views

Hello! I have a PDF that pulls info into it using form fields. Is there a way to split a whole dollar amount into millions, thousands and hundreds using a formula? Say the field name is bondamount

 

thanks and appreciate any help

2 replies

Nesa Nurani
Community Expert
Community Expert
January 13, 2025

You want to show each in a different field?

EDIT:
You can use a script like this in each field as custom calculation script:
For millions:

var bondamount = Number(this.getField("bondamount").valueAsString);

if (bondamount != 0) {
 event.value = Math.floor(bondamount / 1000000);} 
else {
 event.value = "";}

For thousands:

var bondamount = Number(this.getField("bondamount").valueAsString);

if (bondamount != 0) {
 event.value = Math.floor((bondamount % 1000000) / 1000);} 
else {
 event.value = "";}

For hundreds:

var bondamount = Number(this.getField("bondamount").valueAsString);

if (bondamount != 0) {
 event.value = Math.floor(bondamount % 1000);} 
else {
 event.value = "";}

 

tony_8109Author
Participant
January 13, 2025

That's perfect. Thank you so much!