Display a number with thousand separator in Indian style using NPOI

后端 未结 3 1315
野趣味
野趣味 2021-01-27 10:42

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

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(

3条回答
  •  耶瑟儿~
    2021-01-27 11:05

    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");
    

提交回复
热议问题