找回密码
 立即注册

QQ登录

只需一步,快速开始

kamehameha

论坛元老

17

主题

58

帖子

1万

积分

论坛元老

积分
17001

活字格认证

kamehameha
论坛元老   /  发表于:2012-9-10 16:15  /   查看:10866  /  回复:10
如题

10 个回复

倒序浏览
iceman
社区贡献组   /  发表于:2012-9-10 16:40:00
沙发
回复 1楼kamehameha的帖子

请使用以下代码测试:

  1. protected void Page_Load(object sender, EventArgs e)
  2.         {
  3.             if (IsPostBack)
  4.             {
  5.                 return;
  6.             }
  7.             FarPoint.Web.Spread.DoubleCellType dblc = new FarPoint.Web.Spread.DoubleCellType();
  8.             dblc.DecimalDigits = 3;
  9.             dblc.FixedPoint = true;
  10.             FpSpread1.ActiveSheetView.Cells[0, 0].CellType = dblc;
  11.             FpSpread1.ActiveSheetView.Cells[0, 0].Value = 435.98745;
  12.         }
复制代码
回复 使用道具 举报
kamehameha
论坛元老   /  发表于:2012-9-10 16:42:00
板凳
需要加上
  1. this.FpSpread1.ActiveSheetView.Cells[0, 0].CellType = dblc;
复制代码

这句吗
回复 使用道具 举报
kamehameha
论坛元老   /  发表于:2012-9-10 16:49:00
地板
多谢多谢 了然了
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2012-9-10 17:35:00
5#
回复 4楼kamehameha的帖子

客气了。
回复 使用道具 举报
study1990
金牌服务用户   /  发表于:2013-2-25 09:55:00
6#
回复 5楼iceman的帖子

希望在设置只添加千分符不填入小数位数的货币属性后,有几位小数就显示几位小数,即便小数位数变化也一样,怎么实现?
回复 使用道具 举报
ZenosZeng讲师达人认证 悬赏达人认证
超级版主   /  发表于:2013-2-25 17:31:00
7#
回复 6楼study1990的帖子

你可以将CurrencyDecimalDigits 设置为你需要的数量:
  1.     protected void Page_Load(object sender, EventArgs e)
  2.     {
  3.         if (!IsPostBack)
  4.         {
  5.             FarPoint.Web.Spread.CurrencyCellType cct = new FarPoint.Web.Spread.CurrencyCellType();
  6.             System.Globalization.NumberFormatInfo nfi = new System.Globalization.NumberFormatInfo();
  7.             nfi.CurrencyDecimalDigits = 10;
  8.             cct.NumberFormat = nfi;
  9.             cct.NumberFormat.CurrencySymbol = "¥";
  10.             FpSpread1.ActiveSheetView.Columns[0].CellType = cct;
  11.         }
  12.     }
复制代码
回复 使用道具 举报
study1990
金牌服务用户   /  发表于:2013-2-26 08:33:00
8#
回复 7楼dof的帖子

我知道了,将CurrencyDecimalDigits设置的大一点,并且FixedPoint = false,就好了。。。
谢谢!
回复 使用道具 举报
ZenosZeng讲师达人认证 悬赏达人认证
超级版主   /  发表于:2013-2-26 11:21:00
9#
回复 使用道具 举报
cingsoft
高级会员   /  发表于:2015-7-8 16:22:00
10#
回复 2楼iceman的帖子

ActiveSheetView 这个我需要添加那个引用 我这边提示我的这个工作簿不包含这个ActiveSheetView 定义
回复 使用道具 举报
12下一页
您需要登录后才可以回帖 登录 | 立即注册
返回顶部