JavaScript Calculator
Sunday, November 9th, 2008So I made this online calculator that lets you type in commands and equations
http://www.sapethemape.com/calc.html
I based it off of a Mac Widget Calculate I had that was AWESOME! Windows Sidebar Gagdet Calculatorium is also very good. What I liked was it had history and it was more of a command line calculator than a typical button presser. Instead of pressing buttons, you could enter mathmatical expressions and it would solve it.
For mine, you can hit up and down arrows to scroll through your input history, exape clears it, and if you hit + - * / it automatically enters answer (the previous answer); next I need to resize it… But I want to port it to AIR. Except ActionScript doesn’t have an EVAL function. Javascript does. Eval basically does all the work, parses the expression for me. There is a ? for help, just lists the JS Math function available. A friend just pointed out 1^4 = 5, so I need to add parsing for that.
Then I want to make it for my G1. I tested this version, but the keycodes for + - * / are different on the mobile keyboard because it wouldn’t automatically add ‘answer’. If you want to help, you can add errors to the comments here. Just view source for source code. Yes, you can steal it. But its prolly not worth stealing =P.