Tandy 1000 Basic Reference Manual page 275

Hide thumbs Also See for 1000:
Table of Contents

Advertisement

Chapter 10 I BASIC Keywords
Specifiers for Numeric Fields:
#
prints the same number of digit positions as number
signs
(#I.
Numbers are rounded as necessary.
You may insert a decimal point
at
any position. BASIC
always prints the digits preceding the decimal point. If
there is no number, BASIC prints a zero.
If the number to be printed has fewer digits than posi-
tions specified, the number is right-justified (preceded
by spaces). If the number to be printed is larger than
the specified numeric field, a percent sign
(%)
is
printed in front of the number.
P R I N T
US
I
NG
' I # # . # # ' I ;
1
1 1
. 2 2
P R I N T
U S
I
NG
' I # # . # # ' I ;
. 7 5
P R I N T
US
I
NG
I . # # # .
# # " ; 8 7 6 . 5 6 7
BASIC prints %111.22, 0.75 and 876.57, respectively.
If the number of digits specified exceeds 24, an "Illegal
function call" occurs.
prints the sign of the number. The plus sign may be
typed
at
the beginning or
at
the end of the format
string.
+
P R I N T
USING
' I + # # . # # ' I ;
- 9 8 . 4 5 , 3 . 5 0 , 2 2 . 2 2 , - . 9
BASIC prints: -98.45
+
3.50
+
22.22
-0.90
P R I N T
USING
' I # # . # # + ' I ;
- 9 8 . 4 5 , 3 . 5 0 , 2 2 . 2 2 , - . 9
BASIC prints: 98.45-
3.50
+
22.22
+
0.90-
(Note the use of spaces at the end of a format string to
separate printed values.)
prints a negative sign after negative numbers (and a
space after positive numbers).
-
P R I N T
U S I N G
l o # # # . # - " ;
-768.668
BASIC prints 768.7-.
273

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents