To create a format, point to New in the Explorer menu and choose Format. The Format Definition window will appear.
The Format Definition window can also be opened from the Data Type Definition window. Open the data type to be formatted and click the Format lookup button in Data Type Definition window to view the list of existing formats. Click New to open the Format Definition window.
Enter the name in the Format Name field. The format name will appear in a list of formats so the format can be selected easily and used again.
Like the data type name, the format name should be descriptive but not too long. When re-using a format, a descriptive name will allow you to pick out the appropriate format from the format list without opening the format to see its characteristics.
If you opened the Format Definition window by using the Resource Explorer or the Explorer menu, specify which type of format you are creating - currency, string, composite or numeric. If you opened the Format Definition window from the Data Type Definition window, the type of format has already been specified.
The formatting options available depend upon the type of format you are creating. The following charts show which options are available for each type:
Numeric formats |
|
---|---|
Decimal Digits |
Number of decimal places (0 to 5). |
Negative Symbol |
The operating system setting, a minus sign, the letters CR, or parentheses. |
Alignment |
Number is left-, center- or right-aligned. |
Fill |
Unused spaces are filled with asterisks, zeros or spaces. |
Unsigned |
If marked, the negative symbol won’t be displayed. |
Show Thousands Separator |
If marked, the field will show thousands separators in the number. |
Show Percent Sign |
If marked, the field will show the percent sign. |
Currency formats |
|
---|---|
Decimal Digits |
Number of decimal places (0 to 5). |
Negative Symbol |
The operating system setting, a minus sign, the letters CR, or parentheses. |
Alignment |
Number is left-, center- or right-aligned. |
Fill |
Unused spaces are filled with asterisks, zeros or spaces. |
Unsigned |
If marked, the negative symbol won’t be displayed. |
Show Thousands Separator |
If marked, the field will show thousands separators in the number. |
Relative Decimal Position |
If marked, the number of decimal digits selected is added to the number in the operating system setting. The total can be up to 5 decimal digits. |
Show Currency Symbol |
If marked, the currency symbol specified in the operating system settings is displayed. |
String and composite formats |
|
---|---|
Alignment |
String is left-, center- or right-aligned. |
Fill |
Unused characters are filled with asterisks, zeros or spaces. |
Trailing Blanks |
If marked, any spaces that follow the contents of the field will be saved in the file. If the selection isn’t marked, any spaces following the item in the field won’t be saved in a file. This selection can be left unmarked to ensure that the same entry made with or without trailing blanks will be stored with the same value. |
Leading Blanks |
If marked, spaces can be entered as the first characters in the field. These spaces will be saved in a file. |
Numeric Only |
If marked, only numbers can be entered in the field. |
Alphanumeric Only |
If marked, only letters and numbers can be entered in the field. |
Uppercase Only |
If marked, all alphabetic characters will be displayed in uppercase. |
The format string controls the formatting for strings or composites. It contains any extra characters used in the format, along with placeholders that show where the stored data will be displayed. The following table shows the use of placeholders for strings and composites:
Type |
Placeholder |
Example |
---|---|---|
String |
Capital Xs |
(XXX)-XXX-XXXX |
Composite |
Numbers indicating the components to display. |
1111-2222-33333 |
After entering the format string, click Insert to save it. Any additional format strings you add will be inserted below the format selected in the Format Strings list. If no format string is selected, the additional format string will be inserted at the top of the list.
Click OK to save the format definition.