adding / subtracting numbers
Posted: Fri Feb 12, 2010 10:20 pm
any ideas on how I would add and/or subtract a string of numbers? I was able to figure it out if the string is only adding numbers but not both.
For example:
a user would enter numbers into a field (similar to a spreadsheet) like 100+200+300 and then hit enter. I want to then show the total which would be 600. again, I was able to write a function to do that but what if the string had a combination of "+" and "-"... like 100+200+300-50 or 100-50+200-75....
Thanks, Dan
For example:
a user would enter numbers into a field (similar to a spreadsheet) like 100+200+300 and then hit enter. I want to then show the total which would be 600. again, I was able to write a function to do that but what if the string had a combination of "+" and "-"... like 100+200+300-50 or 100-50+200-75....
Thanks, Dan