Display a number with thousand separator in Indian style using NPOI

后端 未结 3 1324
野趣味
野趣味 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:10

    Try this

    int value 773740;
    Response.Write(value.ToString("N"));
    //or
    Response.Write(value.ToString("#,#"));
    

    To format double to string with use of thousands separator use zero and comma separator before an usual float formatting pattern, e.g. pattern „0,0.0“ formats the number to use thousands separators and to have one decimal place.

    String.Format("{0:0,0.0}", 12345.67);     // "12,345.7"
    String.Format("{0:0,0}", 12345.67);       // "12,346"
    

    Refer more here http://www.csharp-examples.net/string-format-double/

提交回复
热议问题