我想在 gridview 列中只显示 2 位小数。列名称为 InsuaranceAmount、TotalAmount 和 TravelAssistAmoun。
for (int i = 0; i < bookingDetailsEmailRS.Length - 1; i++)
{
BookingDetailsEmailRS[] bookingDetailsEmailRS = b.GetBookingDetails(soap, emailid, out errorCode, out errorAtNode);
GridView1.DataSource = bookingDetailsEmailRS.Select(obj => new
{
TravelerName = obj.Travelers[0].FirstName + obj.Travelers[0].MiddleName + obj.Travelers[0].LastName,
obj.BookingNumber,
obj.BookingStatus,
obj.ContactNumber,
obj.CouponDiscountAmount,
obj.DepartureDate,
obj.FromCity,
obj.ToCity,
obj.PaidAmount,
obj.TicketType,
obj.InsuaranceAmount,
obj.TotalAmount,
obj.TravelAssistAmount
}).ToList();
GridView1.DataBind();
}
在这个变量 bookingDetailsEmailRS 中,我得到了响应。