Package io.github.dornol.excelkit.excel
Enum Class ExcelDataFormat
- All Implemented Interfaces:
Serializable,Comparable<ExcelDataFormat>,Constable
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
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionKorean currency with "원" suffix (e.g., 1,000원)US currency with "$" prefix and 2 decimal places (e.g., $1,000.00)Date only format (e.g., 2025-07-19)Date-time format (e.g., 2025-07-19 14:23:00)Number with thousand separator and no decimals (e.g., 1,000)Number with 1 decimal place (e.g., 1,000.1)Number with 2 decimal places (e.g., 1,000.12)Number with 4 decimal places (e.g., 1,000.1234)Percent format with 2 decimal places (e.g., 12.34%)Time only format (e.g., 14:23:00) -
Method Summary
Modifier and TypeMethodDescriptionReturns the Excel-compatible format string.static ExcelDataFormatReturns the enum constant of this class with the specified name.static ExcelDataFormat[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NUMBER
Number with thousand separator and no decimals (e.g., 1,000) -
NUMBER_1
Number with 1 decimal place (e.g., 1,000.1) -
NUMBER_2
Number with 2 decimal places (e.g., 1,000.12) -
NUMBER_4
Number with 4 decimal places (e.g., 1,000.1234) -
PERCENT
Percent format with 2 decimal places (e.g., 12.34%) -
DATETIME
Date-time format (e.g., 2025-07-19 14:23:00) -
DATE
Date only format (e.g., 2025-07-19) -
TIME
Time only format (e.g., 14:23:00) -
CURRENCY_KRW
Korean currency with "원" suffix (e.g., 1,000원) -
CURRENCY_USD
US currency with "$" prefix and 2 decimal places (e.g., $1,000.00)
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
getFormat
Returns the Excel-compatible format string.- Returns:
- Excel format string (e.g., "#,##0.00", "yyyy-mm-dd", etc.)
-