显示了一些使用NPOI千位分隔符印度风格 [英] Display a number with thousand separator in Indian style using NPOI

查看:1095
本文介绍了显示了一些使用NPOI千位分隔符印度风格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用VS2008,ASP.net,C#.NET。

I am using VS2008,ASP.net,C#.net.

我有一个使用NPOI DLL导出到Excel 2003中的网络广告应用程式。
我如何在导出的Excel表千位分隔符印度风格(12 12,34,567.89)显示数字?这些细胞与数量应适用于应用式(总和())

I have a web applicaion which uses NPOI dll to export to excel 2003. How do I display a number with thousand separator in Indian style( 12, 12,34,567.89)in the exported excel sheet? These cells with the number should applicable to apply formula (sum())

推荐答案

与NPOI试试这个神奇的印度风格格式:

with NPOI try this magic to format with Indian style:

ICell cell = row.GetCell(0);
cell.SetCellValue(1234567.89d);
IDataFormat dataFormatCustom = workbook.CreateDataFormat();
cell.CellStyle.DataFormat = dataFormatCustom.GetFormat("[>=10000000]##\\,##\\,##\\,##0;[>=100000] ##\\,##\\,##0;##,##0.00");

这篇关于显示了一些使用NPOI千位分隔符印度风格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆