Rounding by quarter decimals
Can you help me with the following? In my Adobe fillable form, I want the output to be rounded to the nearest quarter hour, so in this case, 9.75.
INPUT (UnitsRow1): Enter Units per Month: 1,200
OUTPUT (AvgRow1): Average Hours Per Day: 9.86
- Text field properties, Calculate. Simplified field notation: (UnitsRow1*12/365/4)
I also have the following Custom Format Script
if (event.target.value >= 10) {
event.target.textColor = ["RGB", 255/255, 0, 0];
}
else if (event.target.value <= 10) {
event.target.textColor = ["RGB", 0, 0, 0];
}
var x = Number(event.value);
if(event.value)
event.value = x.toFixed(2) ;
And a custom validation script:
event.target.textColor = (event.value > 10 || event.value < 10) ? color.black : color.red;
