Guardian Procedure Calls Reference Manual

Decimal alignment characterV
Decimal alignment character.
The field width w is determined by the number of characters, including spaces but excluding Vs,
between the mask delimiters. The field processed is w characters starting at the current position.
After the field is processed, the current position is advanced by w characters. Except for the decimal
point alignment character, V, each character in the mask either defines a character position in the
field or is directly inserted in the field.
The M edit descriptor causes numeric data elements to be rounded to the number of positions
specified by the mask. String data elements are processed directly. Each digit or character of a
data element is transferred to the result field in the next available character position that corresponds
to a digit selector in the mask. If the digit selector is a 9, it causes the corresponding data digit to
be transferred to the output field. The digit selector Z causes a nonzero, or embedded zero, digit
to be transferred to the field, but inserts blanks in place of leading or trailing zeros. Character
positions must be allocated, by Z digit selectors, within the mask to provide for the inclusion of
any minus signs or decoration character strings. A decimal point in the mask can be used for
decimal point alignment of the external field. The letter V can also be used for this purpose. If a V
is present in the mask, the decimal point is located at the V, and the position occupied by the V
is deleted. If no V is present, the decimal point is located at the rightmost occurrence of the decimal
point character (usually .). If neither a V nor a decimal point character is present, the decimal point
is assumed to be to the right of the rightmost character of the entire mask.
Although leading and trailing text in a mask is always transferred to the result field, text embedded
between digit selectors is transferred only if the corresponding digits to the right and left are
transferred.
For example, a value that is intended to represent a date can be formatted with an M field descriptor
as follows:
ResultData ValueFormat
|10/31/79|103179M"99/99/99"
This is a comparison of the effects of using the 9 and Z as digit selectors. The minus sign in the
preceding examples is the symbol that is automatically displayed for negative values in the absence
of any specification to the contrary by a decoration. As shown in the preceding examples, a
decimal point in the mask can be used for radix point alignment of the external field. Additional
examples follow here:
ResultData ValueFormat
-27.40 12.00 00.00 /\ /\ /\-27.40, 12, 03M<Z99.99>
-27.40 12.00 0.00 /\ /\ /\-27.40, 12, 03M<ZZ9.99>
-27.40 12.00 00 /\ /\ /\-27.40, 12, 03M<ZZZ.99>
The "/\" marker is used to denote the boundaries of the output field.
In the example below, a comma specified as mask text is not displayed.
ResultData ValueFormat
| 32.01|32.009M'Z,ZZ9.99'
The "|"character is used to denote the boundaries of the output field.
Compare the different treatment of the embedded commas in these examples:
Data Values: 298738472, 389487.987, 666, 0.35
Format One: M<$ ZZZ,ZZZ,ZZ9 AND NO CENTS>
Repeatable Edit Descriptors 1563