HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)

6-: 16
5Z, 5D, and 5* output a five-digit value the same way (because the value
has no leading zeros).
The digits in the integer part of a number can be represented by any
digit symbol; however, all of the digits must be represented by the same
digit symbol, with one exception. The digit in the one's place can be
represented by Z, regardless of the symbol that represents the other
digits. For example, DDD.DD, ZZZ.DD, ***.DD, DDZ.DD, and **Z.DD are
legal. DZD.DD, Z**.DD, and *DZ.DD are illegal. Each digit in the
fractional part of a number must be represented by D.
Examples
100 A=123.45
110 B=67.8
120 C=90
130 D=0.2
140 E=0.76
150 PRINT USING 200; A,A,A,A,A
160 PRINT USING 200; B,B,B,B,B
170 PRINT USING 200; C,C,C,C,C
180 PRINT USING 200; D,D,D,D,D
190 PRINT USING 200; E,E,E,E,E
200 IMAGE DDD.DD,2X, ZZZ.DD,2X, ***.DD,2X, DDZ.DD,2X, **Z.DD
999 END
The above program prints:
123.45 123.45 123.45 123.45 123.45
67.80 067.80 *67.80 67.80 *67.80
90.00 090.00 *90.00 90.00 *90.00
.20 000.20 ***.20 0.20 **0.20
.76 000.76 ***.76 0.76 **0.76
If a numeric output format specifies x digits to the right of the radix,
and the output value is precise to more than x digits, the DISP USING or
PRINT USING statement prints the output value, rounded to x decimal
places. Rounding the output does not actually change the value.
If a numeric output format specifies x digits to the right of the radix,
and the output value is precise to fewer than x digits, the DISP USING or
PRINT USING statement prints zeros in place of the missing digits.
Examples
100 X=1.2938
110 Y=3.7465
120 Z=4.99
130 DISP USING 160; X,X,X,X
140 DISP USING 160; Y,Y,Y,Y
150 DISP USING 160; Z,Z,Z,Z
160 IMAGE D.DDDD,2X, D.DDD,2X, D.DD,2X, D.D
170 DISP USING "D.DDDD,2X,D.DDDD,2X,D.DD"; X,Y,Z
999 END
The above program prints:
1.2938 1.294 1.29 1.3
3.7465 3.747 3.75 4.0
4.9900 4.990 4.99 5.0
1.2938 3.7465 4.99
Radix Symbols. The radix symbols, (period (.) and R), specify the
character that separates the integer and fractional parts of a number.
It can be either a decimal point or a comma. In a numeric specifier, a
period (.) specifies a decimal point and an R specifies a comma. A
numeric specifier can have at most one radix symbol.