ZeeGrid Programming Reference

Cell FORMAT Attribute


Cell FORMAT Attribute

Every ZeeGrid cell has a FORMAT attribute. The format attribute determines the display format of numeric and date data.

The FORMAT attribute defaults to 0. There are two valid values for the FORMAT attribute for numeric data, 0 and 1.

Numeric data that has a format of 0 will display its data in a normal numeric fashion.

Numeric data that has a format of 1 will display its data as a percentage. For instance, if the cell contains the numeric value of 0.1567, the ZeeGrid will display this cell as 15.67%

The number of decimal places displayed is determined by the PRECISION (ZGM_SETCELLNUMPRECISION) attribute of the ZeeGrid cell. Cells with numeric data that have a precision attribute value of 0 will display as integer values.

There are five valid values for the FORMAT attribute for date data, [0..4]. For example, the date 'February 3, 1965' will be displayed as follows for the given formats:

A related attribute is the NUMWIDTH (ZGM_SETCELLNUMWIDTH) attribute. This value defaults to 0 and there is really no need that comes to mind where this attribute value would need to be changed. It was initially used in the ZeeGrid to left pad numeric values with spaces so that the sorting function would operate correctly. An earlier implementation of the sort function sorted by the text value of the cell. The sort operation was rewritten to sort based on type, then value, so the original purpose of the NUMWIDTH attribute is defunct now, but is still implemented in case the programmer finds the need for it.

ZeeGrid messages related to the FORMAT attribute:

ZeeGridTMCopyright © 2002-2016 by David Hillard