s = edit(edit_pattern, numeric_expression);
The edit function converts a number to a character string defined by the given "edit pattern". The "edit pattern" is a string containing "Z"s and/or "9"s (i.e., "9999" or "ZZ9.99"). Both "9" and "Z" represent a digit as follows:
9 | display a digit |
Z | display a digit, but if it would be a leading zero for the given width, display a blank |
. | display the decimal character |
, | display the thousands separator character |
Any other character will be displayed as itself.
The function returns a string derived from the numeric_expression argument.
X = 87;
A1 = edit("ZZZ9",X); // yields A1 = " 87"
A2 = edit("9999",X); // yields A2 = "0087"
A3 = edit("Z999",X); // yields A3 = " 087"
Y = 0;
A4 = edit("ZZ9",Y); // yields A4 = " 0"
A5 = edit("999",Y); // yields A5 = "000"
A6 = edit("ZZZ",Y); // yields A6 = " "
T = edit("99:99:99", systime()); // yields T = "16:04:42" for the time 4:04pm and 42 seconds
A = edit("ZZZ,ZZZ,ZZ9", INCOME);