Help! How to evaluate a math expression (in text format)

J

JM

Hi,

I have an string with a math expression, example str = "Log(5) +3 "

How can i convert it into a numeric value?

Thanks,

Jaime
 
A

Albert D. Kallal

Simply use the eval functon.

dim str as string

str = "log(5) + 3"

msgbox "result = " & eval(str)
 
Top