Top Description Fields Constructors Methods
org.apache.poi.ss.usermodel

public final Class BuiltinFormats

extends Object
Class Inheritance

Utility to identify built-in formats. The following is a list of the formats as returned by this class.

0, "General"
1, "0"
2, "0.00"
3, "#,##0"
4, "#,##0.00"
5, "$#,##0_);($#,##0)"
6, "$#,##0_);[Red]($#,##0)"
7, "$#,##0.00);($#,##0.00)"
8, "$#,##0.00_);[Red]($#,##0.00)"
9, "0%"
0xa, "0.00%"
0xb, "0.00E+00"
0xc, "# ?/?"
0xd, "# ??/??"
0xe, "m/d/yy"
0xf, "d-mmm-yy"
0x10, "d-mmm"
0x11, "mmm-yy"
0x12, "h:mm AM/PM"
0x13, "h:mm:ss AM/PM"
0x14, "h:mm"
0x15, "h:mm:ss"
0x16, "m/d/yy h:mm"

// 0x17 - 0x24 reserved for international and undocumented 0x25, "#,##0_);(#,##0)"
0x26, "#,##0_);[Red](#,##0)"
0x27, "#,##0.00_);(#,##0.00)"
0x28, "#,##0.00_);[Red](#,##0.00)"
0x29, "_(* #,##0_);_(* (#,##0);_(* \"-\"_);_(@_)"
0x2a, "_($* #,##0_);_($* (#,##0);_($* \"-\"_);_(@_)"
0x2b, "_(* #,##0.00_);_(* (#,##0.00);_(* \"-\"??_);_(@_)"
0x2c, "_($* #,##0.00_);_($* (#,##0.00);_($* \"-\"??_);_(@_)"
0x2d, "mm:ss"
0x2e, "[h]:mm:ss"
0x2f, "mm:ss.0"
0x30, "##0.0E+0"
0x31, "@" - This is text format.
0x31 "text" - Alias for "@"

Field Summary

Modifier and TypeField and Description
private static final String[]
public static final int
FIRST_USER_DEFINED_FORMAT_INDEX

The first user-defined number format starts at 164.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static String[]

Returns:

array of built-in data formats
getAll
()

public static String

Returns:

string represented at index of format or null if there is not a built-in format at that index
getBuiltinFormat
(int
of a built in format
index
)

Get the format string that matches the given format index

public static int

Returns:

index of format or -1 if undefined.
getBuiltinFormat
(String
string matching a built-in format
pFmt
)

Get the format index that matches the given format string.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_formatsback to summary
private static final String[] _formats
FIRST_USER_DEFINED_FORMAT_INDEXback to summary
public static final int FIRST_USER_DEFINED_FORMAT_INDEX

The first user-defined number format starts at 164.

Constructor Detail

BuiltinFormatsback to summary
public BuiltinFormats()

Method Detail

getAllback to summary
public static String[] getAll()
Returns:String[]

array of built-in data formats

getBuiltinFormatback to summary
public static String getBuiltinFormat(int index)

Get the format string that matches the given format index

Parameters
index:int

of a built in format

Returns:String

string represented at index of format or null if there is not a built-in format at that index

getBuiltinFormatback to summary
public static int getBuiltinFormat(String pFmt)

Get the format index that matches the given format string.
Automatically converts "text" to excel's format string to represent text.

Parameters
pFmt:String

string matching a built-in format

Returns:int

index of format or -1 if undefined.