【发布时间】:2019-03-12 08:45:08
【问题描述】:
我有 3 个值,即 AmountOfRent 、 AmountPaid 和 RemainingAmount 。
如何减去 AmountOfRent 和 AmountPaid 以获得 RemainingAmount 的值
AmountOfRent - AmountPaid = RemainingAmount
我不知道如何在 mvc 中编写代码。
<td>
@Html.DisplayFor(modelItem => item.contracts.AmountOfRent)
</td>
<td>
@Html.DisplayFor(modelItem => item.AmountPaid)
</td>
<td>
@Html.DisplayFor(modelItem => item.RemainingAmount)
</td>
【问题讨论】:
-
你的意思是
(item.contracts.AmountOfRent - item.AmountPaid)吗? -
在控制器中计算该值?
-
(item.contracts.AmountOfRent - item.AmountPaid) 是的,我的意思是
-
我该怎么做?可以写代码
-
首先学习如何编码 ;)
标签: c# asp.net-mvc count subtraction