SUMMARY
When FoxBASE+ converts a numeric value to a string, the numeric is
automatically left padded to a length of 10 characters.
For example, if a program contains the following code
x = 455
? STR(x), LTRIM(STR(x))
it returns the following values: " 455", "455".
To string numeric values with decimals, include the length of the
entire number and the number of decimal places desired to display. The
following are examples of using the STR() function with numbers that
include decimals:
x = 234.98
? STR(x,10,2), LTRIM(STR(x,10,2))
The program returns the following values: " 234.98","234.98".
When doing string comparisons, it is important to make sure the values
being compared are in the same format. If the above values are
compared, they will not be equal. For example:
x=12
? STR(x)=LTRIM(STR(x)) && returns .F.