我正在尝试使用 2 个 Tal 条件语句来检查代码是否是两件事之一,然后执行相应的计算。但发生的是它并排打印出两个条件的结果。
谢谢!
Unit 4.5522 0.0000
unit.. . 3.7628 0.0000
Unit 0.0000 14.6083
unit 0.0000 31.9430
<td style="text-align: right;">
<span tal:condition="python:float(result.totdirrn)!=0 and (result.wkld1_desc!='Proceedures' and result.wkld1_desc!='Visits')">
<span tal:replace="python:'%.4f'%(float(result.cenmn)/((((float(result.dirhrs)*(float(float(result.totdirrn)/float(result.dirhrs))))/14)/12)/2))">currentindex</span>
<span tal:condition="python:float(result.totdirrn)!=0 and (result.wkld1_desc!='Census')">
<span tal:replace="python:'%.4f'%(float(result.vipr)/((((float(result.dirhrs)*(float(float(result.totdirrn)/float(result.dirhrs))))/14)/12)/2))">currentindex</span></span>
</span>
<span tal:condition="python:(float(result.totdirrn)==0)">
<span tal:replace="python:'%.1f'%(0.0)"></span></span>
</td>