Sorry, this is a super stupid problem but I'm new to PHP and failed at solving it myself.
On my node I have an energy field (Radioactivity module) and a computed field. The computed field is supposed to read out the node's current energy, plug it into a function and return another value.
I have tried all of
float( $entity->field_energy ),
float( $entity->field_energy['value'] ), and
float( array_pop(array_pop(field_get_items($entity_type, $entity, 'field_energy'))) )
to read out the node's current energy, but everythings gives me an error. When I replace the above with a static number everything works fine.
Can anyone tell me how to read out the energy? I don't even know what data type is used to store the energy.
(I couldn't add a radioactivity tag. Unfortunately I don't have enough reputation points for doing so.)