【发布时间】:2016-05-24 04:41:58
【问题描述】:
我有这个由 Sum LinQ 组成的组,但它给了我一个包含很多小数的结果有没有办法将数字四舍五入?不显示小数? 这是我的 LinQ:
@foreach (var item in Model.Select(x => new //here you count your total
{
Rid = x.Rid,
Total = x.Total * x.Cantidad
})
.GroupBy(l => l.Rid) //and then grouping
.Select(z => new
{
Turno = z.Key,
Total = z.Sum(l => l.Total)
}))
{
<input value="@item" />
}
【问题讨论】:
标签: c# decimal number-formatting