I have the following tal condition code that in theory is supposed to work, but it is not performing the condition check. the form hits this condition, runs it and then returns a divide by 0 division error instead of a 0
Im working with incomplete data on purpose, this is to make sure that error pages dont generate, the cell in the table just shows a 0.
<td style="text-align: right;">
<span tal:condition="python:result.sum_adt_out<>0">
<span tal:replace="python:'%.1f'%((float(result.sum_cenmn) or 0)/float(result.sum_adt_out))">currentindex</span></span>
<span tal:condition="python:result.sum_adt_out==0">
<span tal:replace="python:'%.1f'%(0.0)"></span></span>
</td>
if anyone has any ideas, they would be much appreciated.