How To Set Cell Data Type

前端 未结 3 1209
庸人自扰
庸人自扰 2021-02-14 14:24

I am trying to set data type of cell, but it seems that\'s impossible to do with EPPlus.

If I place a number as value in cell, I get General data type in exported Excel

3条回答
  •  余生分开走
    2021-02-14 15:21

    Here are the 49 formats listed in EPPlus/EPPlus/Style/ExcelNumberFormat.cs (located here):

    "General"
    "0"
    "0.00"
    "#,##0"
    "#,##0.00"
    "0%"
    "0.00%"
    "0.00E+00"
    "# ?/?"
    "# ??/??"
    "mm-dd-yy"
    "d-mmm-yy"
    "d-mmm"
    "mmm-yy"
    "h:mm AM/PM"
    "h:mm:ss AM/PM"
    "h:mm"
    "h:mm:ss"
    "m/d/yy h:mm"
    "#,##0 ;(#,##0)"
    "#,##0 ;[Red](#,##0)"
    "#,##0.00;(#,##0.00)"
    "#,##0.00;[Red](#,#)"
    "mm:ss"
    "[h]:mm:ss"
    "mmss.0"
    "##0.0"
    "@"
    

提交回复
热议问题