Enum Class ExcelDataFormat

java.lang.Object
java.lang.Enum<ExcelDataFormat>
io.github.dornol.excelkit.excel.ExcelDataFormat
All Implemented Interfaces:
Serializable, Comparable<ExcelDataFormat>, Constable

public enum ExcelDataFormat extends Enum<ExcelDataFormat>
Predefined Excel-compatible data format strings used for number, date, time, and currency formatting.

These formats are used to configure CellStyle in Excel export. You can apply them via ExcelDataType or directly when building columns.

Since:
2025-07-19
  • Enum Constant Details

    • NUMBER

      public static final ExcelDataFormat NUMBER
      Number with thousand separator and no decimals (e.g., 1,000)
    • NUMBER_1

      public static final ExcelDataFormat NUMBER_1
      Number with 1 decimal place (e.g., 1,000.1)
    • NUMBER_2

      public static final ExcelDataFormat NUMBER_2
      Number with 2 decimal places (e.g., 1,000.12)
    • NUMBER_4

      public static final ExcelDataFormat NUMBER_4
      Number with 4 decimal places (e.g., 1,000.1234)
    • PERCENT

      public static final ExcelDataFormat PERCENT
      Percent format with 2 decimal places (e.g., 12.34%)
    • DATETIME

      public static final ExcelDataFormat DATETIME
      Date-time format (e.g., 2025-07-19 14:23:00)
    • DATE

      public static final ExcelDataFormat DATE
      Date only format (e.g., 2025-07-19)
    • TIME

      public static final ExcelDataFormat TIME
      Time only format (e.g., 14:23:00)
    • CURRENCY_KRW

      public static final ExcelDataFormat CURRENCY_KRW
      Korean currency with "원" suffix (e.g., 1,000원)
    • CURRENCY_USD

      public static final ExcelDataFormat CURRENCY_USD
      US currency with "$" prefix and 2 decimal places (e.g., $1,000.00)
  • Method Details

    • values

      public static ExcelDataFormat[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ExcelDataFormat valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getFormat

      public String getFormat()
      Returns the Excel-compatible format string.
      Returns:
      Excel format string (e.g., "#,##0.00", "yyyy-mm-dd", etc.)