Download Plus Library Manual

Transcript
UBC PLUS LIBRARY
29
Result
Varying_String
The result returned contains either the converted integer
of an error message.
Description
This routine can be used to convert numeric values to many
different forms of character representation. The form of
the
output
string
is
described
by
a "picture"
specification similar to those of Cobol or PL/1.
The number is first converted to a sequence of digits,
which is then edited under control of the picture.
Pictures can be used to effect scaling, left-or-right zero
suppression, comma and decimal point insertion, fixed or
varying field width of the converted item.
Pictures
A picture is sequence of characters describing the format
desired for the converted string. The characters forming
the picture may be any of the following:
9
specifies
digit.
the position is to be occupied by a
blank
used in place of "9" to indicate replacement
of leading or trailing zeros with blanks.
Z, z
used in place of "9" to indicate suppression
of leading or trailing zeros.
.
specifies literal insertion of a ".", if the
position is followed by a digit. That is,
decimal does not appear if it is passed over
by right zero suppression. If it is preceded
or followed by a blank, it will be replaced by
a blank.
D, d
specifies literal insertion of a "."
there is no following character.
,
specifies
literal
insertion of a comma;
suppressed if not both preceded and followed
by a digit. If it is preceded or followed by
a blank, it will be replaced by a blank.
V, v
indicates the position at which to align the
decimal point of the number being converted
(i.e., the right-hand end of the number).
If
this is omitted, it is assumed to be at the
right-hand end of the picture.
The "V" has
the effect of scaling the value.
even
if