How to calculate a formula entered into an edittext?

Last Updated:

  1. nonextstop

    nonextstop Member

    I remember seeing a tutorial a few months back that I cant seem to find anywhere :(
    Basically, theres a single EditText, Button, and TextView, and an onClickListener takes the formula that is entered into the EditText (Example: (5^12(6.3+12) / (12 * .01)) ) and it would calculate it and output the answer on the TextView. If anyone can explain how to do this, or link me to the tutorial, it would be greatly appreciated!

  2. Kostas G

    Kostas G Active Member

    I am not aware of the tutorial you are referring to, but what you need is a mathematical parser. Many alternative solutions are discussed in this Stackoverflow question.

Share This Page