First of all thanks for this awesome module.

I just had this question: How can i prevent the rendering of the computed field if the calculation results 0/null/error as a cause of another field being left blank. Since the computed field i created needs the value of another float field, if the other one doesn't get a value, then my computed field renders with the output of 0.
I would like it to not render at all.

Is it possible to achieve this?

Best regards

Elvin Xhimitiku

Comments

colan’s picture

Status: Active » Fixed

You would need to (1) set your field as a string in the configuration, and then (2) return the empty string in order to achieve this behaviour. The module is designed this way because folks would generally want to show the number "0" as a result if it's calculated from something.

colan’s picture

Title: How to prevent the rendering of the computed field if the calculation results 0/null/error » Don't render zero/null/error

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

colan’s picture

Or at least it should work that way. Too many strings are being considered empty. See #1440234: Zeroes in string types are assumed to be empty (DB used for storage) for details.