1. Introducing Channels - a new way to chat with other Android users!
    Dismiss Notice

How to calculate a formula entered into an edittext?


Last Updated:

  1. nonextstop

    nonextstop Member This Topic's Starter

    Joined:
    Oct 20, 2010
    Messages:
    7
    Likes Received:
    0
    Hey,
    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!
    Thanks!
     

    Advertisement
  2. Kostas G

    Kostas G Active Member

    Joined:
    Aug 23, 2012
    Messages:
    42
    Likes Received:
    7
    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

Loading...