Next: 4. Built-in Functions Up: 3. Calculations Previous: 3.2 SpreadScript Formulas   Contents   Index

# 3.3 SpreadScript Numeric and Date/Time Display Formats

All numeric data storage and computation in SpreadScript use IEEE double precision floating point. Each worksheet cell has an associated display format and precision which will determine how its numeric contents will appear when retrieved with the Worksheet::getText() method, or when the cell is viewed from NExS or Excel. Tables 3.2 and 3.3 list the formats supported by SpreadScript and the associated parameters for specifying the formats with Worksheet::setFormat().

Table 3.2: SpreadScript Numeric Data Display Formats
Format Code Definition
Scientific SS_FMT_FLOAT Displays the number in scientific notation (exponent form) with N significant digits.
Fixed SS_FMT_FIXED Displays the number using a fixed number of decimal places, specified by N.
General SS_FMT_GEN Displays the number in fixed format or scientific notation, whichever fits. Trailing zeros are not displayed.
Dollars SS_FMT_DOLLARS Displays the number with a leading \$ sign and with comma delimiters, as in \$1,000,000. Negative values are displayed in parentheses.
Comma SS_FMT_COMMA Displays the number with comma delimiters, as in 1,000,000. Negative values are displayed in parentheses.
Percent SS_FMT_PERCENT Display the number as a percentage, multiplying it by 100. For example, the value 0.1 is displayed as 10.00%.
Hex SS_FMT_HEX Displays the integer portion of the number in base 16 with a leading 0x indicator. For example, the value 30.5 would be displayed as 0x1e.
Logic SS_FMT_LOGIC Displays the value 0 as 0, the value 1 as 1, and all other values as ?.
Hidden SS_FMT_HIDDEN The cell contents are not displayed.
Text SS_FMT_TEXT For cells which contains formulas, the formula itself is displayed, rather than the computed value of the cell.

Table 3.3: SpreadScript Date and Time Display Formats
Format Code Definition
MM/DD/YY SS_FMT_DATE Displays the integer portion of a date/time value in the format 08/01/91, where the date represented is 1 August, 1991.
DD/MM/YY SS_FMT_DATE_ALT Displays the integer portion of a date/time value in the format 08/01/91, where the date represented is 8 January, 1991.
DD-MMM-YY SS_FMT_DAY_MONTH_YEAR Displays the integer portion of a date/time value as a Gregorian date, in the format 01-Aug-91.
MMM-YY SS_FMT_MONTH_YEAR Displays the integer portion of a date/time value in the format Aug-91.
DD-MMM SS_FMT_DAY_MONTH Displays the integer portion of a date/time value in the format 01-Aug.
DD.MM.YYYY SS_FMT_INTL_DATE Displays the integer portion of a date/time value in the format 01.08.2002.
YYYY-MM-DD SS_FMT_ISO8061_DATE Displays the integer portion of a date/time value in the ISO 8061 date format 2002-08-01.
HH:MM:SS SS_FMT_TIME Displays the fractional portion of a date/time value in the format 06:15:30.

Next: 4. Built-in Functions Up: 3. Calculations Previous: 3.2 SpreadScript Formulas   Contents   Index