PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Division by Zero

  1. aepihq
    Member

    I have a field that has a donation amount. I have another field that lets the user choose if they are paying in full today or splitting into monthly payments. If they go with monthly payments, I have a product (which only shows on the condition they selected monthly payments). That product is a calculation which takes the total donation and divides it by the number of payments. All works well except when they choose to pay in full and this field does not appear. After subimtting I receive a "Division by zero" warning in /wp-content/plugins/gravityforms/common.php(4498) : eval()'d code on line 1

    Its like the calculation is being run even through the field is not displayed. Any suggestions? Thanks.

    Posted 11 years ago on Thursday February 14, 2013 | Permalink
  2. aepihq
    Member

    Nevermind, I have solved this problem by altering by calculating so that it can never result in a division by 0. Still, I think not calculating if the field's condition hasn't been met would be a good idea.

    Posted 11 years ago on Thursday February 14, 2013 | Permalink
  3. That's a good point. I'll tag it as a feature request for the development team.

    Posted 11 years ago on Sunday February 17, 2013 | Permalink