Copy link to clipboard
Copied
I'm attempting to place a divison calulcation in a filable form and I keep getting this error: 'The value entered does not match the format of the field [TotalCompPerHoursWorked].
I would like the following calculations to work. Total Compenstation Paid ÷ Hours Worked = Total Comp Per Hours Worked.
I have the following as values for each item...
Total Compenstation Paid (AdditionalComp, CompHoursWorked)
Hours Worked (Value is not calculated)
Total Compenstation per Hours Worked (TotalCompPaid/HoursWorked)
I have these Text Field Properties for Total Compenstation per Hours Worked :
Number
1,234.56
Before with space
I also have a Name and Date text box at the top of this form. If I type in them I get the error code as well.
I very new to this. I have done basic addition and subtraction in Adobe with no problems.
I can't to find a simple answer to my challenge on the internet. Any help with a simple explanation would be most helpful!
Copy link to clipboard
Copied
Error happens because you used SFN to divide two fields and it try to divide with zero so you can get Infinity or NaN errors in your field, instead use "Custom calculation script" and try this code:
var x = this.getField("TotalCompPaid").value;
var y = this.getField("HoursWorked").value;
if(y == 0) event.value = "";
else
event.value = x/y;
Copy link to clipboard
Copied
Hi there
Hope you are doing well and sorry for the trouble. As described you need help with division calculation.
The workflow you are trying to achieve is possible using a custom calculation script. For more help, please check the help article https://acrobatusers.com/tutorials/javascript_console/
Hope it will help
Regards
Amal
Copy link to clipboard
Copied
Error happens because you used SFN to divide two fields and it try to divide with zero so you can get Infinity or NaN errors in your field, instead use "Custom calculation script" and try this code:
var x = this.getField("TotalCompPaid").value;
var y = this.getField("HoursWorked").value;
if(y == 0) event.value = "";
else
event.value = x/y;
Copy link to clipboard
Copied
Thanks everyone for the help!
Copy link to clipboard
Copied
This is the solve. You are awesome!!!!!!!!! Thank you Nesa.
Copy link to clipboard
Copied
This is the solve. You are awesome!!!!!!!!! Thank you Nesa.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now