微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

计算平均值

如何解决计算平均值

我已经建立了一个表格,玩家可以在其中输入三个不同单元格中的三个收入值。我想设置计算平均值的第四个单元格。有什么想法吗?

<table class="table-bordered" style="width:100%">
    <tr style="background-color:#ffb380">
        <th scope="col"  colspan="1" style="text-align:center"> Anno </th>
        <th scope="col"  colspan="1" style="text-align:center"> 2018 - 2019 </th>
        <th scope="col"  colspan="1" style="text-align:center"> 2019 - 2020 </th>
        <th scope="col"  colspan="1" style="text-align:center"> 2020 - 2021 </th>
        <th scope="col"  colspan="1" style="text-align:center"> Reddito MEdio</th>
    </tr>
    <tr style="background-color:#ffe0cc">
        <td scope="col"  colspan="1" style="text-align:center"> Reddito/etTaro </td>
        <td scope="col"  colspan="1" style="text-align:center"> {% formfield 'income1'%} €/ha </td>
        <td scope="col"  colspan="1" style="text-align:center"> {% formfield 'income2'%} €/ha </td>
        <td scope="col"  colspan="1" style="text-align:center"> {% formfield 'income3'%} €/ha </td>
        <td scope="col"  colspan="1" style="text-align:center"> 'inc_avg' €/ha </td>
    </tr>
</table>

{%formfield 'income1' %} 等是玩家输入值的整数字段。

P.S.:我正在使用 otree

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。