DADiSP Worksheet Functions > Function Categories > Numerical Formatting > SETFORMAT

 

SETFORMAT

Purpose:

Sets the display type for numerical values, including table listings and scales.

Syntax:

SETFORMAT(mode, "formstr")

mode

-

An integer, the numeric format mode:

 

Mode

Resulting Format

-1

Auto Format (default)

0

Regular Floating Notation

1

Exponential Notation with Uppercase 'E’

2

Picks Most Concise of Mode 0 or 1

3

Exponential Notation with Lowercase 'e'

4

Picks Most Concise of Mode 0 or 3

5

User Specified Format String

6

Hex Format

7

Rational (integer fraction) Format

 

"formstr"

-

Optional. A String. A user defined format string. Do not specify mode when using this option.

Returns:

An integer or string, the previous format value. Returns the previous format string if the previous mode was 5, else returns the previous format mode as an integer.

Example:

setformat(0)

 

Sets the display type to regular floating notation.

Example:

setformat("%ld")

 

Sets the display type to integer notation. All values will be displayed to the nearest, lowest integer value similar to FLOOR.

Example:

f = setformat("%1.32f");

disp(eps);

setformat(f);

 

Displays EPS to 32 digits in a popup box and restores the original format.

Remarks:

Use in conjunction with SETPRECISION to control the appearance of numerical values.

 

This function affects the display of numerical values everywhere in the Worksheet, not just the current Window.

 

The optional "formstr" format string must be of the form supported by SPRINTF. If specified, "formstr" overrides the precision value set by SETPRECISION

See Also:

SETPRECISION

SPRINTF

RAT