Skip to main content
stepheng54012748
Known Participant
December 16, 2024
Answered

Rounding Validation script for Adobe Acrobat

  • December 16, 2024
  • 7 replies
  • 733 views

I'm hoping someone can help me out with a validation script where the answer will round to 0.  So, if the script results in an amount of $83,333.33, I'd the validation script to round this to 0 or in this case the answer would be $83,333.00.  I have no idea how to write this one.  this is where i'm stuck:   if(event.value==

 

Thank you for any feedback on this one.

 

 

This topic has been closed for replies.
Correct answer try67

This is not very accurate. It should actually be:

 

/*your calculation goes here*/

event.value=Math.round(event.value);

7 replies

PDF Automation Station
Community Expert
Community Expert
December 16, 2024

Shouldn't it be a calculation script? 

event.value=Math.round(/*your calculation goes here*/);

stepheng54012748
Known Participant
December 17, 2024

This doesn't work.  I have a calculation script in place already.  I want to validate the result of the script.  Seems to me that i could do something like this to validate the result:

 

if(event.value>0)event.value=Math.round(/*event.value*/;

PDF Automation Station
Community Expert
Community Expert
December 17, 2024

That won't work.  The validate script runs before the calculation script.  What is your calculation script?