I've setup a computed field that calculates an average from two fields. Now when I leaves those fields empty of put '0' in them, I got this warning message:
"warning: Division by zero in /home/afcain5/public_html/sites/all/modules/computed_field/computed_field.module(161) : eval()'d code on line 1"
even though it did saves it but how can I set it up where it won't evaluates when the values are "NULL" or "0"???

Thanks.

Comments

tm541’s picture

Following, I am getting the same error.

xqbzzr’s picture

Same here. I am doing some calculations across different fields. I can add a discount percentage that multiplies the value. When i leave the discount field empty I get a similar error:
Notice: Undefined offset: 0 in eval() (Zeile 1 von /www/htdocs/xyz/D7/sites/all/modules/computed_field/computed_field.module(466) : eval()'d code).
I do not get the error when entering 0 into the discount. But that always renders the field as "Discount: 0".
But the rest of the calculation works fine.

dqd’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

Due to the Drupal core life cycle policy and security support advisery, Drupal 6 is no longer supported. So issues for Drupal 6 cannot be longer maintained. The project maintainer has asked for closing all D6 issues to clean up the issue queue. Feel free to reopen the issue if required or set it to "needs to be ported" and latest D8 dev version, if the issue discusses a still missing feature which can be implemented in the D8 version.

dqd’s picture

Status: Closed (won't fix) » Closed (outdated)