[AccessD] Re: Number vs text data type

Gustav Brock gustav at cactus.dk
Tue Oct 14 02:18:59 CDT 2003


Hi Lambert

This is not correct - you must be thinking of Str() which adds a
leading place holder (space) for the sign but doesn't display a plus
sign, thus 

   2 displays as " 2"
  -2 displays as "-2"

which has the advantage of listing positive and negative numbers
nicely when using a monospaced font.

Like CStr(), Format() does not have this behaviour. You can, however,
tell Format() to act like Str() this way:

  strVal = Format(lngVal," 0;-0")

But why should you? Str() is very much faster than Format().

/gustav


> Format *always* pads with one space, to get more just include spaces in the
> format string, thus...

> format(2,"0") will display (without the quotes) " 2"
> format(2," 0") will display "  2"

> if you don't want any padding use Cstr instead of Format.



More information about the AccessD mailing list