找回密码
 立即注册

QQ登录

只需一步,快速开始

huluyuan

新手上路

1

主题

1

帖子

22

积分

新手上路

积分
22
  • 20

    金币

  • 主题

  • 帖子

最新发帖
huluyuan
新手上路   /  发表于:2010-12-11 23:30  /   查看:8414  /  回复:5
数据在数据库中存储形式是123.000,读取之后显示123,需要显示成为123.000,通过下面语句设置后依然没有反应。
FarPoint.Web.Spread.DoubleCellType dblcell = new FarPoint.Web.Spread.DoubleCellType();
        FpSpread1.Sheets[0].Columns[3].CellType = dblcell;
不知有没有什么好的的办法。

5 个回复

倒序浏览
gw0506
超级版主   /  发表于:2010-12-12 00:39:00
沙发
DecimalPlaces。
默认是-1,保留2位小数。
设置为几就是保留几位小数。
回复 使用道具 举报
xinyu0430163com
新手上路   /  发表于:2010-12-17 11:29:00
板凳
VB:
Dim objgencell4 As New FarPoint.Web.Spread.GeneralCellType()   '4位小数
         '设置为4位小数
Dim numform4 As System.Globalization.NumberFormatInfo = CType(System.Globalization.NumberFormatInfo.CurrentInfo.Clone(), System.Globalization.NumberFormatInfo)
        numform4.NumberDecimalDigits = 4
        numform4.NumberDecimalSeparator = "."
        objgencell4.NumberFormat = numform4

C#:
FarPoint.Web.Spread.GeneralCellType objgencell4 = new FarPoint.Web.Spread.GeneralCellType();
//4位小数
//设置为4位小数
System.Globalization.NumberFormatInfo numform4 = (System.Globalization.NumberFormatInfo)System.Globalization.NumberFormatInfo.CurrentInfo.Clone();
numform4.NumberDecimalDigits = 4;
numform4.NumberDecimalSeparator = ".";
objgencell4.NumberFormat = numform4;
回复 使用道具 举报
study1990
金牌服务用户   /  发表于:2012-11-22 09:30:00
地板
回复 使用道具 举报
moriya
论坛元老   /  发表于:2012-11-22 10:15:00
5#
定義 小數點后6位

FarPoint.Web.Spread.DoubleCellType dct = new FarPoint.Web.Spread.DoubleCellType();

    dct.DecimalDigits = 6;

    FpSpread1.ActiveSheetView.Cells[1, 1].CellType = dct;

    FpSpread1.ActiveSheetView.Cells[1, 1].Value = 1.12345678;
回复 使用道具 举报
ZenosZeng讲师达人认证 悬赏达人认证
超级版主   /  发表于:2012-11-23 18:10:00
6#
回复 5楼moriya的帖子

moriya 你好

你的这个需求,你可以参考Spread ASP.NET 6.0帮助文档中的Spread ASP.NET 6.0 Product Documentation > Client-Side Scripting Reference > Scripting Overview > Developing a Custom HTC File > Formatting Percent Value on the Client 章节
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部