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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top