Copy link to clipboard
Copied
Hello, I am currently using this as a custom validation script. This takes a value, divides it in two and rounds down, the rounds down part is key.
var v = Number(this.getField("GST2").valueAsString) / 2;
var nDecimals = 2;
event.value = Math.floor(v * Math.pow(10, nDecimals)) / Math.pow(10, nDecimals);
I need the field to not show the $0.00 and still round the result down, so $1.05 is rounded down to .52 cents, if that makes sense, I know it needs this if (event.value==0) event.value = "" but I can n ot get it to work.
Copy link to clipboard
Copied
- This should be a calculation script, not a validation one.
-Adding the code you posted to the end of your current code should take care of the zero values and not display them.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more