<script id="allhunxingtmpl" type="text/x-jquery-tmpl">
??{{each(dongi,dongitem) 总户型}}
??<tr style="display: flex" ?class="trTable">
??????<th style="width: 25%;text-align:center;"">{{= dongitem[‘公摊面积‘]?dongitem[‘公摊面积‘].toFixed(2):dongitem[‘公摊面积‘]}}</th>
??????<th style="width: 25%;text-align:center;"">{{= dongitem[‘套内面积‘]?dongitem[‘套内面积‘].toFixed(2):dongitem[‘套内面积‘]}}</th>
??????<th style="width: 25%;text-align:center;"">{{= dongitem[‘套数‘]}}</th>
??????<th style="width: 25%;text-align:center;"">{{= dongitem[‘建筑面积‘]?dongitem[‘建筑面积‘].toFixed(2):dongitem[‘建筑面积‘]}}</th>
?</tr>
{{/each}}
</script>
jquery tmpl 模板引擎 取小数点 ?三目运算
原文地址:https://www.cnblogs.com/yixiaoyang-/p/10368796.html