Author Topic: Evaluate a string....  (Read 1563 times)

0 Members and 1 Guest are viewing this topic.

Shade

  • Guest
Evaluate a string....
« on: September 21, 2007, 11:13:16 AM »
If I have a string like "32/3", is it possible to have autolisp evaluate the string so that 10.666667 is returned instead of 32?
(atof "32/3") returns 32, instead of 10.66667 which is what i need.

I have a cvs file I made in excel, where the values are stored in fractional format for better accuracy.

ie. 32/3, 8/3, 1/12, 8/5, etc.

I then take this data and import it into Autocad through a lisp that converts a cvs file to a list.

ie. ("32/3" "8/3" "1/12" "8/5")

I would then like to take the individual string and have autocad evaluate and return the fraction in decimal format.

ie. "32/3" is returned as 10.666666666667.

Is this possible?
Any help would be apprecited
Thanks.  :mrgreen:

Chuck Gabriel

  • Guest
Re: Evaluate a string....
« Reply #1 on: September 21, 2007, 11:17:56 AM »
Try distof instead of atof.

Shade

  • Guest
Re: Evaluate a string....
« Reply #2 on: September 21, 2007, 11:20:11 AM »
Thanks mate,
Thats works for me!