Specifications
Defining display formats
266 InfoMaker
Use at least one 0
In general, a number display format should include at least one 0. If you enter
0 in a field with the mask ###, the field will appear to be blank if you do not
provide a zero-format section. If the mask is ###.##, only the period displays.
If you want two decimal places to display even if both are 0, use the mask
##0.00.
Number keywords
You can use the following keywords as number display formats when you want
InfoMaker to determine an appropriate format to use:
•
[General]
• [Currency]
Note that [Currency(7)] and [Currency(n)] are legal edit masks, but they are not
legal display formats.
Percentages
Use caution when defining an edit mask for a percentage. When you enter a
number in a column with a percent edit mask and tab off the column,
InfoMaker divides the number by 100 and stores the result in the buffer. For
example, if you enter 23, InfoMaker passes .23 to the buffer. When you retrieve
from the database, InfoMaker multiplies the number by 100 and, if the mask is
##0%, displays 23%.
The datatype for the column must be numeric or decimal to handle the result of
a division by 100. If the column has an integer datatype, a percentage entered
as 333 is retrieved from the database as 300, and 33 is retrieved as 0.
If you use an edit mask with decimals, such as ##0.00%, the datatype must
have enough decimal places to handle the division. For example, if you enter
33.33, the datatype for the column must have at least four decimal places
because the result of the division is .3333. If the datatype has only three
decimal places, the percentage is retrieved as 33.30.
Examples
Table 8-3 shows how the values 5, –5, and .5 display when different format
masks are applied.
Table 8-3: Number display format examples
Format 5 -5 .5
[General] 5 -5 0.5
05-51
0.00 5.00 -5.00 0.50
#,##0 5 -5 1
#,##0.00 5.00 -5.00 0.50
$#,##0;($#,##0) $5 ($5) $1