回复 1楼qinyu1021的帖子
qinyu1021 你好,
小数点计算精度可以通过 NumberCellType 的 DecimalPlaces 属性来设置,把公式所在单元格设置为 NumberCellType 即可控制小数位。
- FarPoint.Win.Spread.CellType.NumberCellType num = new FarPoint.Win.Spread.CellType.NumberCellType();
- num.DecimalPlaces = 3;
- num.DecimalSeparator = ",";
- num.FixedPoint = true;
- num.LeadingZero = FarPoint.Win.Spread.CellType.LeadingZero.UseRegional;
- num.MaximumValue = 50000.0;
- num.MinimumValue = -1000.0;
- num.NegativeFormat = FarPoint.Win.Spread.CellType.NegativeFormat.Parentheses;
- num.NegativeRed = true;
- num.Separator = "/";
- num.ShowSeparator = true;
- num.SpinButton = true;
- num.SpinDecimalIncrement = 10;
- num.SpinIntegerIncrement = 5;
- num.SpinWrap = true;
- fpSpread1.ActiveSheet.Cells[0, 0].CellType = num;
- fpSpread1.ActiveSheet.Cells[0, 0].Value = -443.0908;
复制代码 |