>I have a problem converting a string to a value
>The problem is that "val" returns a value like 55.8412
>The last to digits  are lost??
>
>dim pos as string
>pos=55.841234
>dim valpos as float
>valpos= val(pos)
>note valpos

Experimentation suggests that the digits are lost twice.
First when converting 55.841234 to a string "55.8412"
during the assignment to the string variable pos, and
then again when converting the contents of valpos to
a string.

To print 8 digits from valpos, you need to make two changes:
place the constant in quotation marks when assigning it to
the string variable pos, and use the Format$() function to
force converting all 8 digits back into a string.

dim pos as string
pos="55.841234"
dim valpos as float
valpos= val(pos)
note format$(valpos, "#.######")



----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to