找回密码
 立即注册

QQ登录

只需一步,快速开始

wangfabei1989

高级会员

11

主题

24

帖子

1127

积分

高级会员

积分
1127

活字格认证

wangfabei1989
高级会员   /  发表于:2014-6-26 15:16  /   查看:5188  /  回复:1
spread 5.0 for .net win form 将表格某一列设置为number,如何设置小数点后的位数 谢谢

1 个回复

倒序浏览
iceman
社区贡献组   /  发表于:2014-6-26 18:54:00
沙发
回复 1楼wangfabei1989的帖子

请使用以下代码测试,DecimalPlaces 属性控制小数位数:

  1. FarPoint.Win.Spread.CellType.NumberCellType num = new FarPoint.Win.Spread.CellType.NumberCellType();
  2. num.DecimalPlaces = 3;
  3. num.DecimalSeparator = ",";
  4. num.FixedPoint = true;
  5. num.LeadingZero = FarPoint.Win.Spread.CellType.LeadingZero.UseRegional;
  6. num.MaximumValue = 50000.0;
  7. num.MinimumValue = -1000.0;
  8. num.NegativeFormat = FarPoint.Win.Spread.CellType.NegativeFormat.Parentheses;
  9. num.NegativeRed = true;
  10. num.Separator = "/";
  11. num.ShowSeparator = true;
  12. num.SpinButton = true;
  13. num.SpinDecimalIncrement = 10;
  14. num.SpinIntegerIncrement = 5;
  15. num.SpinWrap = true;
  16. fpSpread1.ActiveSheet.Cells[0, 0].CellType = num;
  17. fpSpread1.ActiveSheet.Cells[0, 0].Value = -443.0908;
复制代码
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部