找回密码
 立即注册

QQ登录

只需一步,快速开始

gsyxy100

初级会员

27

主题

82

帖子

223

积分

初级会员

积分
223

活字格认证微信认证勋章

gsyxy100
初级会员   /  发表于:2017-9-21 09:47  /   查看:3948  /  回复:7
FarPoint.Web.Spread.DoubleCellType DoubleCellType = new FarPoint.Web.Spread.DoubleCellType();
                    int nDecimalDigits =6;
                    DoubleCellType.MaximumValue = 10000000000;
                    DoubleCellType.MinimumValue = -10000000000;
                    FpSpread1.Sheets[OneWeb.SheetIndex].Cells[OneWeb.RowNum, OneWeb.ColNum].CellType = DoubleCellType;

数据在输入0.000005时以科学计数法显示了,如何设置?
FarPoint.Web.Spread.TextCellType TextCellType = new FarPoint.Web.Spread.TextCellType();下可以,但我输入框有数据类型验证,只能用DoubleCellType 。

7 个回复

倒序浏览
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2017-9-21 13:56:23
沙发
我这里没有重现出您的问题,您是就加了一下代码吗

            FarPoint.Web.Spread.DoubleCellType DoubleCellType = new FarPoint.Web.Spread.DoubleCellType();
            int nDecimalDigits = 6;
            DoubleCellType.MaximumValue = 10000000000;
            DoubleCellType.MinimumValue = -10000000000;
            FpSpread1.Sheets[0].Cells[0, 0].CellType = DoubleCellType;
回复 使用道具 举报
gsyxy100
初级会员   /  发表于:2017-9-22 09:58:47
板凳
本帖最后由 gsyxy100 于 2017-9-22 09:59 编辑

问题已经解决
FarPoint.Web.Spread.DoubleCellType DoubleCellType = new FarPoint.Web.Spread.DoubleCellType();
int nDecimalDigits = 6;
DoubleCellType.MaximumValue = 10000000000;
DoubleCellType.MinimumValue = -10000000000;

System.Globalization.NumberFormatInfo CellFormat = new System.Globalization.NumberFormatInfo();
CellFormat.NumberDecimalDigits = 6;
DoubleCellType.NumberFormat = CellFormat;
FpSpread1.Sheets[OneWeb.SheetIndex].Cells[OneWeb.RowNum, OneWeb.ColNum].CellType = DoubleCellType;

数据大时会有千分位,如:666,888,666.258可以去掉千分位符号吗?
回复 使用道具 举报
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2017-9-22 11:56:56
地板
设置 NumberGroupSeparator

            DoubleCellType.NumberFormat = new System.Globalization.NumberFormatInfo();
            DoubleCellType.NumberFormat.NumberGroupSeparator = "";
回复 使用道具 举报
gsyxy100
初级会员   /  发表于:2018-1-5 16:47:24
5#
System.Globalization.NumberFormatInfo nb = new System.Globalization.NumberFormatInfo();
                  nb.NumberDecimalDigits = 4;
                  nb.NumberGroupSizes = new int[]{0};
回复 使用道具 举报
Clark.Pan讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2018-1-9 16:11:04
6#
您好:

请问您的这个问题解决了吗?
回复 使用道具 举报
gsyxy100
初级会员   /  发表于:2019-2-22 16:25:55
7#
ClarkPan 发表于 2018-1-9 16:11
您好:

请问您的这个问题解决了吗?

问题已经解决,楼上我有回复你看。
回复 使用道具 举报
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2019-2-22 17:45:27
8#
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部