Copy link to clipboard
Copied
event.value = this.getField("X").value / (10); event.value = Math.floor(event.value);
I have this case of script but if "X" is negative i would like the script to change and round up instead of rounding down the result. I have no idea on how to do so, can someone help???
Copy link to clipboard
Copied
Use this code:
var x = Number(this.getField("X").value) / 10;
if (x<0) x = Math.ceil(x);
else x = Math.floor(x);
event.value = x;
In the future post such questions in the Acrobat forum, please, not the Reader one.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now