formatΒΆ
format sets the output format for the print command.
- bool = format()
- bool = format(ssFormat)
- bool = format(rsSplitWidth)
- bool = format(rsFieldWidth, rsPrecision)
Return Value
bool is TRUE (1) if the function was successful and FALSE (0) if an error occurs.
Parameters
- ssFormat
ssFormat can be one of the following strings:
Value |
Meaning |
---|---|
|
(see example) |
|
(see example) |
|
(see example) |
|
(Defaultwert) |
|
(see example) |
|
(see example) |
- rsSplitWidth
rsSplitWidth (default is -1)
- rsFieldWidth
rsFieldWidth (see example)
- rsPrecision
rsPrecision (default is 10, 4)
Comment
If format is call without a parameter, all settings will be set to default.
Example
* a = rand(1,10)
* a
0.0370 0.2906 0.0861 0.7476 0.3594 0.2081
0.0798 0.1479 0.7082 0.3954
* format(60)
1.0000
* a
Spalten 1 bis 5
0.0370 0.2906 0.0861 0.7476 0.3594
Spalten 6 bis 10
0.2081 0.0798 0.1479 0.7082 0.3954
* format("+")
+
* a
++++++++++
* a[4] = 0
* a
+++ ++++++
* format("-")
+
* a
+++-++++++
* format("e")
1.0000e+000
* a
Spalten 1 bis 5
3.7013e-002 2.9060e-001 8.6077e-002 0.0000e+000 3.5945e-001
Spalten 6 bis 10
2.0813e-001 7.9766e-002 1.4793e-001 7.0816e-001 3.9545e-001
* format("g")
1
* a
Spalten 1 bis 5
0.03701 0.2906 0.08608 0 0.3594
Spalten 6 bis 10
0.2081 0.07977 0.1479 0.7082 0.3954
* format("f")
1
* format(5, 1)
1.0
* a
Spalten 1 bis 10
0.0 0.3 0.1 0.0 0.4 0.2 0.1 0.1 0.7 0.4
* format()
1.0000
See also
id-454281