Skip to main content

Android: Parse simple mathematical formula from string

I have users entering numbers into an EditText fields, but what I would like them to be able to write things likeenter is 100+32+10 into the fields as well. I expect simple expressions only, common four functions. In fact, just addition would cut it too.

For just addition, I guess it wouldn't be that hard to split up the string and do it myself I suppose, but I'm curious to know if there is a library which can do what I want much more cleanly.

Any suggestions?

Android: Parse simple mathematical formula string

I have users entering numbers into EditText fields, but would like them to be able to write things like 100+32+10 into the fields as well. I expect simple expressions only, common four functions. In fact, just addition would cut it too.

For just addition, I guess it wouldn't be that hard to split up the string and do it myself I suppose, but I'm curious to know if there is a library which can do what I want much more cleanly.

Any suggestions?

Android: Parse simple mathematical formula from string

I have users entering numbers into an EditText fields, but what I would like them to be able to enter is 100+32+10 into the fields as well. I expect simple expressions only, common four functions. In fact, just addition would cut it too.

For just addition, I guess it wouldn't be that hard to split up the string and do it myself I suppose, but I'm curious to know if there is a library which can do what I want much more cleanly.

Any suggestions?

Source Link
capcom
  • 3.3k
  • 12
  • 43
  • 50

Android: Parse simple mathematical formula string

I have users entering numbers into EditText fields, but would like them to be able to write things like 100+32+10 into the fields as well. I expect simple expressions only, common four functions. In fact, just addition would cut it too.

For just addition, I guess it wouldn't be that hard to split up the string and do it myself I suppose, but I'm curious to know if there is a library which can do what I want much more cleanly.

Any suggestions?