1
我有这个Group by Sum LinQ,但它给了我很多小数的结果是否有一种方法来收集数字?不显示小数? 这是我的LinQ:Linq Sum Group by by decimals
@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" />
}
非常感谢这是我一直在寻找的方法 –