Difference between revisions of "More Calculator Functions"
Jump to navigation
Jump to search
Shane112358 (talk | contribs) |
Shane112358 (talk | contribs) |
||
Line 1: | Line 1: | ||
− | Bottom line - there are secondary calculator functions already built in. Just push the space bar. Below is the coding showing where I found it. I'm currently working on | + | Bottom line - there are secondary calculator functions already built in. Just push the space bar. Below is the coding showing where I found it. I'm currently working on replacing some of the functions with more useful ones (like x^y)...Go to bottom for that. |
If you go to | If you go to | ||
Line 61: | Line 61: | ||
event.stop(); | event.stop(); | ||
},</pre> | },</pre> | ||
+ | |||
+ | To change the functions, you can head to | ||
+ | |||
+ | <pre>/usr/palm/applications/com.palm.app.calculator/app/models/calculator.js</pre> | ||
+ | At line 183 is | ||
+ | |||
+ | <pre>percent: function() { | ||
+ | this.xReg = this.xReg / 100; | ||
+ | this.inputBuffer = '' + this.xReg;</pre> | ||
+ | |||
+ | Currently working on changing these to math.pow functions, etc. Bear with me, I'm new Java... |
Revision as of 16:39, 31 July 2009
Bottom line - there are secondary calculator functions already built in. Just push the space bar. Below is the coding showing where I found it. I'm currently working on replacing some of the functions with more useful ones (like x^y)...Go to bottom for that.
If you go to
/usr/palm/applications/com.palm.app.calculator/app/controllers
and look at calculator-assistant.js, you can see the following alternative functions that have always been available - but news to me.
onKeyPress: function(event) { if (Mojo.Char.isEnterKey(event.charCode)) { this.onEqualsPress(event); } else if (event.charCode == Mojo.Char.backspace) { this.onBackspacePress(event); } else if (event.charCode == Mojo.Char.spaceBar) { this.toggleOptionKeyMode(); . . . . onDividePress: function(event) { if (this.optionKeys) { this.calculator.memMinus(); this.showMemoryIndicator(); this.toggleOptionKeyMode(); } else { this.calculator.divide(); } this.updateResults(); event.stop(); }, onMultiplyPress: function(event) { if (this.optionKeys) { this.calculator.percent(); this.toggleOptionKeyMode(); } else { this.calculator.multiply(); } this.updateResults(); event.stop(); }, onSubtractPress: function(event) { if (this.optionKeys) { this.calculator.sqrt(); this.toggleOptionKeyMode(); } else { this.calculator.subtract(); } this.updateResults(); event.stop(); }, onAddPress: function(event) { if (this.optionKeys) { this.calculator.plusMinus(); this.toggleOptionKeyMode(); } else { this.calculator.add(); } this.updateResults(); event.stop(); },
To change the functions, you can head to
/usr/palm/applications/com.palm.app.calculator/app/models/calculator.js
At line 183 is
percent: function() { this.xReg = this.xReg / 100; this.inputBuffer = '' + this.xReg;
Currently working on changing these to math.pow functions, etc. Bear with me, I'm new Java...