Object Reference : Object View and Procedure Reference : Matrix
  
 
setformat
Set the display format for cells in a matrix object spreadsheet view.
Syntax
matrix_name.setformat format_arg
where format_arg is a set of arguments used to specify format settings. If necessary, you should enclose the format_arg in double quotes.
For matrices, setformat operates on all of the cells in the matrix.
To format numeric values, you should use one of the following format specifications:
 
g[.precision]
significant digits
f[.precision]
fixed decimal places
c[.precision]
fixed characters
e[.precision]
scientific/float
p[.precision]
percentage
r[.precision]
fraction
To specify a format that groups digits into thousands using a comma separator, place a “t” after the format character. For example, to obtain a fixed number of decimal places with commas used to separate thousands, use “ft[.precision]”.
To use the period character to separate thousands and commas to denote decimal places, use “..” (two periods) when specifying the precision. For example, to obtain a fixed number of characters with a period used to separate thousands, use “ct[..precision]”.
If you wish to display negative numbers surrounded by parentheses (i.e., display the number -37.2 as “(37.2)”), you should enclose the format string in “()” (e.g., “f(.8)”).
Examples
To set the format for all cells in the matrix to fixed 5-digit precision, simply provide the format specification:
matrix1.setformat f.5
Other format specifications include:
matrix1.setformat f(.7)
matrix1.setformat e.5
Cross-references
See Matrix::setwidth, Matrix::setindent and Matrix::setjust for details on setting spreadsheet widths, indentation and justification.