回复 9楼study1990的帖子
study1990 你好,
因为 “123456.456” 不符合设置的格式,所以会提示出错,可以尝试以下代码:
- FarPoint.Web.Spread.GeneralCellType c = new FarPoint.Web.Spread.GeneralCellType();
- System.Globalization.NumberFormatInfo nfi = new System.Globalization.NumberFormatInfo();
- nfi.NumberDecimalDigits = 3;
- nfi.NumberDecimalSeparator = ",";
- c.NumberFormat = nfi;
- FpSpread1.ActiveSheetView.Cells[0, 0].CellType = c;
- FpSpread1.ActiveSheetView.Cells[0, 0].Value = 234.56;
复制代码 |