一、string.Format()
将【数字字符串】转为两位小数显示的字符串:
1 dt = dtResult.Select(it => new CommodityPriceLimitEntity 2 { 3 CommodityId = it.CommodityId.ToString(), 4 CommodityName = it.CommodityName.ToString(), 5 CommodityCode = it.CommodityCode.ToString(), 6 Price = string.Format("{0:F2}", it.Price) 7 }).ToList();
C# code
--------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------
持续更新中~~
蒙
2017-08-03 13:58 周四
时间: 2024-10-05 14:31:44