Skip to main content
Participating Frequently
Mar 11, 2019 5:53 PM UTC
Answered

Ratio calculation

I have a simple ratio calculation to perform as seen below:

if (this.getField("HiBrach").value=="")

{

event.value="";

}

else

{event.value=this.getField("HiAnk").value / this.getField("HiBrach").value;

}

"HiBrach" is derived from multiple (3) fields with a maximum value calculation performed before the ratio operation.

This works no problem.

However, how does the script change if "HiAnk" is also made up multiple fields with a Maximum value calculation.

I haven't been able to solve this!?

This topic is closed to new replies. Start a new post to keep the conversation going.
Thom Parker
Thom ParkerCorrect answer
Community Expert
Mar 12, 2019 12:52 AM UTC

Just make sure the calculation order is correct. That's all that maters.

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often

4 replies

Thom Parker
Community Expert
Thom ParkerCommunity ExpertCorrect answer
Community Expert
Mar 12, 2019 12:52 AM UTC

Just make sure the calculation order is correct. That's all that maters.

Translate
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Participating Frequently
Mar 12, 2019 9:20 AM UTC

Hi Thom,

Thanks for the response.

In checking the calculation order as suggested, I discovered a syntax error!!!

I did have to adjust the order however, thanks.

Translate
Thom Parker
Community Expert
Community Expert
Mar 12, 2019 4:35 PM UTC

It's always something because code is complicated and must be exact. 

Translate
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
try67
Community Expert
Community Expert
Mar 11, 2019 5:58 PM UTC

It doesn't change at all... Is it not working?

Translate