2

I have a UITextField in my app that I want users to be able to enter equations into. These equations can vary from something as simple as 2+2 to something as crazy as (((4^2) + (6^3)) / 2) * (100 - 14) but no matter how it's formatted, it should always work.

The equation needs to follow order of operations, as well as return the right answer. Any ideas?

Zane Helton
  • 1,044
  • 1
  • 14
  • 34

1 Answers1

2

You should look into a math parser, such as DDMathParser.

For more, see this question.

Community
  • 1
  • 1
shim
  • 9,289
  • 12
  • 69
  • 108