Object Reference : Object View and Procedure Reference : Coef
  
 
setformat
Set the display format for cells in coefficient vector spreadsheet views.
Syntax
coef_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 coefficient vectors, setformat operates on all of the cells in the vector.
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 coefficient vector to fixed 5-digit precision, simply provide the format specification:
c1.setformat f.5
Other format specifications include:
c1.setformat f(.7)
c1.setformat e.5
Cross-references
See Coef::setwidth, Coef::setindent, and Coef::setjust for details on setting spreadsheet widths, indentation and justification.