Programming instructions
Intermec Fingerprint v7.61 – Programmer’s Reference Manual Ed. 7100
Chapter 2 Program Instructions
FORMAT$, cont.
Remarks, cont.
• An empty format string is equivalent to "0.##########".
•
0 and # cannot be mixed in every way. Before the decimal separator,
use # fi rst and then 0. After the decimal separator, use 0 fi rst and then
#. For example: ####00.000### is OK and #00##0.##0#00
is not OK.
• A point or a comma separates integers and decimals. The decimal
separator used in the format is the one that will be the returned separator
type. Independent of the separator type in the number the format type
will control the return type. Default type is a point.
• A format can consist of separators as space between thousands either a
unit as $. For example: "$ ### ### 000.00".
• The attached number string will be truncated to the quantity of
decimal in the format.
• Characters will not be displayed on the left side of the decimal separator if
there is a # on the left side of the characters and the string to be formatted
do not have a digit in the same position as the #. On the right side of the
decimal separator, characters will not be displayed if there is a # on the
right side of the characters and the string to be formatted do not have a
digit in the same position as the
#. For example:
Format string: "\$#\t\e\x\t0.0\t\e\x\t#\$"
String to be formatted: 1.1 55 0.33 55.33
Returned strings: $1.1$ $5text5.0$ $0.3text3$ $5text5.3text3$
Input number: "5" "-5" "0.5" "55555" "0.666666666666"
Input format: Returned number:
"" => 5 -5 0.5 55555 0.6666666666
"0" => 5 -5 0 55555 0
"0.00" => 5.00 -5.00 0.50 55555.00 0.66
"\$0,0" => $5,0 $-5,0 $0.5 $55555,0 $0,6
"0.0##" => 5.0 -5.0 0.5 55555.0 0.666
"###\,000.0" => 005.0 -005.0 000.5 55,555.0 000.6
"# 0 0.0" => 0 5.0 -0 5.0 0 0.5 555 5 5.0 0 0.6
Examples
The following examples show how FLOATCALC$ and FORMAT$ functions
can be combined.
Addition.
B$="234.9"
C$="1001"
D$="# ##0.##"
A$=FLOATCALC$(B$,"+",C$,15)
PRINT A$
yields:
"1235.900000000000000"
PRINT FORMAT$(A$,D$)
yields:
"1 235.9"