Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Copy link to clipboard
Copied
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 = "";}
Copy link to clipboard
Copied
That's perfect. Thank you so much!