Format: F[ormat] [column or default or variable [width decimals]]The FORMAT command allows changes in the way a column is displayed by EDIT, LIST and when the DATA SAVE command is used. The column width and number of decimal places displayed can be changed. If instead of a column the keyword DEFAULT is used, then all new columns will be created according to the specification given. The format of a variable can also be changed, to alter the number of decimal places displayed.
Examples:
Enter command - f c2 6 3This changes the format of the second column so that it is six characters wide and three decimal places be displayed after the decimal point, i.e. numbers will be shown as 23.319, 6.000, etc.
Enter command - FO c3 Width is 4, enter new width or blank line for unchanged: 5 Decimal places currently 2, enter new value or blank line for unchanged: 3If the column or width and decimals parameters are omitted from the command line EASISTAT will request them.
Enter command - F V4 8 6Variable 4 will now be displayed to six decimal places.
Enter command - FO DEF 5 2Here the keyword DEFAULT is used so that from now on whenever the NEW command is used to insert a new column, the column will be displayed with two decimal places and a total width of five characters. When new data is read in from a data file all columns will be displayed with at least two decimal places.
Comments
It is vital to realise that when you save data to disk you are only saving the values to the precision of the current column format. All the time EASISTAT holds data in its memory it treats values as floating point numbers which are stored with a high precision. As soon as they are saved to disk however they are treated as digits as you see them displayed, so that if a fractional number is displayed with no decimal places then it will be saved as a whole number and the fractional part will be lost.
The total column width must always be at least 2 wider than the number of decimal places, so that there is room for the "0." part of the number, as in 0.67. If a number is negative, the width must be at least 3 wider to accommodate the minus sign. The column width must lie between 2 and 12, and the default column width must lie between 3 and 12.
You will not be allowed to make the width too small for either the number or the column title. If values produced by the DERIVE command or read in by the DATA command would be too large to fit in the column with the format specified then the width is increased automatically.
If these two numbers occur in the same column:
125.6 12.45then you cannot have a column width of 5 and and display 2 decimal places because the numbers would appear like this:
125.60 12.45so the total column width would have to be at least 6.