Skip to main content
Henry.Ong
Inspiring
August 6, 2020
Question

How to display simply zero if the the divisor of a calculated field is zero?

  • August 6, 2020
  • 2 replies
  • 403 views

Good day!

 

I am doing a fillable PDF. In this document, I have a Reset Button with the following script ...

if(4==app.alert("This action will clear all input fields in this form.\nDo you want to continue?",1,2))this.resetForm()

In this document, I have a calculated formula  as showned below:

(FI017a+FI018a)/(FI017a+FI017b+FI018a+FI018b)*100

When the Reset Button is click, all the numeric fields will be set to zero thus making the operants of the formula zero including the divisor.

I believe this cause the error ...

"The value entered does not match the format of the field [fieldname].

How can I show zero as the result of the computation and disregard the error message.

Appreciate the help. Thank you.

This topic has been closed for replies.

2 replies

try67
Community Expert
Community Expert
August 6, 2020

You should not show zero in that instance. When the divisor is zero (or empty) the result should be empty.

0/5 = 0

5/0 != 0