John, hope you see this message. Sorry I didn't respond
sooner but the last few days have been very busy. I need
to understand more about the various number types. I have
been using mostly Long Integer and Double, but do not have
a proper grasp of when to use them.
An Integer is a 16-bit number; it allows integral numeric values
between -65536 and 65535. A Long Integer is 32 bits - it is good for
the range -2147483648 to 2147483647, again just integers, no decimals.
Float and Double are "floating point numbers". This is a way of
storing a number in two portions - a binary fraction between 0.5 and
1, and an exponent: a power of two. A Float occupies 32 bits (24 bits
for the fraction, 8 for the exponent), allowing about seven decimal
digits of precision and a range between 10^-38 to 10^38, positive or
negative. A Double is similar but twice as many bits, covering the
range from -1.797*10^308 to 1.797*10^308, with about 14 digits of
precision. Finally a Currency datatype is a special scaled huge
integer, with a range in the trillions and exactly four decimal
places, no more and no fewer.
NONE of these datatypes are appropriate for identifiers such as part
"numbers". If you have a (say) twelve-digit identifier, and you'll
never be doing addition or subtraction or multiplication or division
with it, just store the identifier in a Text datatype. This gives you
up to 255 "digits" of precision, never has roundoff error, and lets
you display leading zeros with no special handling.