Skip to content

formatCell

On this page

Format a cell's value into its display string representation.

Returns the cached cell.w if already computed, otherwise formats the value using the cell's number format string or XF style information.

formatCell(cell: CellObject, value?: any, options?: any): string

Parameters

NameTypeRequiredDescription
cellCellObjectYesThe cell object to format
valueanyNoOptional override value; if omitted, uses cell.v
optionsanyNoOptional settings (e.g. dateNF for a default date format)

Returns

string

The formatted display string, or empty string for null/blank cells