Programming instructions

Intermec Fingerprint v7.61 Programmers Reference Manual Ed. 7 99
Chapter 2 Program Instructions
FORMAT$
Field of Application
Function for formatting a number represented by a string.
Syntax FORMAT$(<sexp
1
>,<sexp
2
>)
<sexp
1
> is the string of numerals, optionally with decimals, which
is to be formatted.
<sexp
2
> speci es the format of the string.
Remarks
The original string (<sexp
1
>) is a string of digits, optionally with a decimal
point to separate decimals from integers. It can also contain leading
plus (+), minus (-), and space characters. Space characters are ignored,
whereas the usual mathematical rules apply to plus and minus signs. All
other characters (or plus, minus, and space characters in other positions
than leading) generate errors.
Note the mathematical rules:
- - yields +
- + yields -
+ - yields -
+ + yields +
The format is speci ed by a string (<sexp
2
>). Different format will give
different result. The string can contain any characters, but some have special
meanings. Note the explanation of the following characters.
0
= Digit place holder, display a digit or zero.
If the input number has fewer digits than there are zeros (on either side
of the decimal separator) in the format string, leading or trailing zeros are
displayed. If the number has more digits to the left side of the decimal
separator than there are zeros to the left side of the separator in the format
string the digits will be displayed. If the number has more digits to the
right of the separator than there are zeros to the right of the decimal
separator in the format string, the decimal will be truncated to as many
decimal places as there are zeros.
# = Digit placeholder, display a digit or nothing.
If there is a digit in the expression being formatted in the position where
the
# appears in the format string, display the digit or otherwise display
nothing in that position. If the number has more digits to the left side of
the decimal separator than there are
# to the left side of the separator in the
format string the digits will be displayed.
. = Decimal separator, to separate the integer and the decimal digits.
, = Decimal separator, to separate the integer and the decimal digits.
\
= Display the next character in the format string.
The backslash itself is not displayed. To display a
\ use two backslashes.
The only character, which will be displayed in the formatted string without
a backslash is space.
space = Space
A space will be displayed as literal character wherever it is in the
expression format.