We help IT Professionals succeed at work.

VB.net Calculate value of formula held in a string

Murray Brown
Murray Brown asked
on
1,760 Views
Last Modified: 2014-05-19
Hi

I have a variable strFormula, which holds the string version of a formula:
eg strFormula = "10*6-(53.7*2.6)"
eg strormula = "22-(55.7/2) + 78.9"
How do I  calculate the value of this formula?
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2016
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Murray BrownASP.net/VBA/VSTO Developer

Author

Commented:
Hi
I get the error "Type 'Expression' is not defined"
CERTIFIED EXPERT
Top Expert 2016

Commented:
Have you downloaded NCalc?
Murray BrownASP.net/VBA/VSTO Developer

Author

Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for murbro's comment #a40071952

for the following reason:

Thanks very much
Please see a further related question
https://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_28435897.html
Murray BrownASP.net/VBA/VSTO Developer

Author

Commented:
Thanks very much
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.