The Multiple Format Selector allows you to change the format applied to a currency or string field while the application is running. Multiple formats are set up by selecting Link Format Selector from the Tools menu while the layout window is active. Dexterity will switch to format linking mode, allowing you to link the string or currency field to an integer field, called a format field. Dexterity will stay in this mode until you choose Link Format Selector from the Tools menu again.
While Dexterity is in format linking mode you can link fields to format fields by dragging from a currency or string field to the integer field you want to link it to. A flashing border around the integer field will indicate that the link was successful. The value of the integer field indicates which format string should be used for the currency or string field. This integer field can be an invisible field or a field such as a drop-down list, allowing the user to specify the format.
The possible formats for currency fields and the integer value associated with them are shown in the following table.
Integer |
Format |
Integer |
Format |
---|---|---|---|
0 |
Control panel defaults |
10 |
$1,234.567 |
1 |
1,234 |
11 |
$1,234.5678 |
2 |
1,234.5 |
12 |
$1,234.56789 |
3 |
1,234.56 |
13 |
1,234% |
4 |
1,234.567 |
14 |
1,234.5% |
5 |
1,234.5678 |
15 |
1,234.56% |
6 |
1,234.56789 |
16 |
1,234.567% |
7 |
$1,234. |
17 |
1,234.5678% |
8 |
$1,234.5 |
18 |
1,234.56789% |
9 |
$1,234.56 |
|
|
The possible formats for variable currency fields and the integer value associated with them are shown in the following table.
Integer |
Format |
Integer |
Format |
Integer |
Format |
---|---|---|---|---|---|
100 |
1 |
200 |
$1 |
300 |
1% |
101 |
1.1 |
201 |
$1.1 |
301 |
1.1% |
102 |
1.12 |
202 |
$1.12 |
302 |
1.12% |
103 |
1.123 |
203 |
$1.123 |
303 |
1.123% |
104 |
1.1234 |
204 |
$1.1234 |
304 |
1.1234% |
105 |
1.12345 |
205 |
$1.12345 |
305 |
1.12345% |
106 |
1.123456 |
206 |
$1.123456 |
306 |
1.123456% |
107 |
1.1234567 |
207 |
$1.1234567 |
307 |
1.1234567% |
108 |
1.12345678 |
208 |
$1.12345678 |
308 |
1.12345678% |
109 |
1.123456789 |
209 |
$1.123456789 |
309 |
1.123456789% |
110 |
1.1234567890 |
210 |
$1.1234567890 |
310 |
1.1234567890% |
111 |
1.12345678901 |
211 |
$1.12345678901 |
311 |
1.12345678901% |
112 |
1.123456789012 |
212 |
$1.123456789012 |
312 |
1.123456789012% |
113 |
1.1234567890123 |
213 |
$1.1234567890123 |
313 |
1.1234567890123% |
114 |
1.12345678901234 |
214 |
$1.12345678901234 |
314 |
1.12345678901234% |
115 |
1.123456789012345 |
215 |
$1.123456789012345 |
315 |
1.123456789012345% |
The integer value that indicates the format used can be stored in a table along with the currency field being formatted. When the record is retrieved from the table, the currency field will display as it did when the record was saved. The format field can also be used for a report, allowing the currency field to appear in the report as it did when it was saved in the table.
You can use functions from the Currency function library to create your own multiformat values. |
The following example uses the Multiple Format Selector for a Quantity field to specify the number of decimal places it will display. The Quantity field uses a currency data type and is linked to a hidden integer field that specifies which format will be applied when the field is displayed in a window or printed on a report. The Quantity field is shown in the following illustration when its linked field has a value 3, indicating that no currency symbol and only two decimal places will be displayed.
For string fields, the integer value indicating the format to use corresponds to the position of the format string in the format definition window.
The following example uses the Multiple Format Selector for a Part Number field that has three different format strings. The user selects the format to apply by selecting the corresponding format in a drop-down list linked to the Part Number field. The three format strings for the Part Number field, entered in the Format Definition window, are shown in the following illustration.
The drop-down list is set to the following value (integer 3), corresponding to the third format string:
The Part Number field will display the following format: