Merge lp:~mihirsoni/ubuntu-calculator-app/1226738 into lp:~ubuntu-calculator-dev/ubuntu-calculator-app/old_trunk

Proposed by Mihir Soni
Status: Merged
Approved by: Riccardo Padovani
Approved revision: 164
Merged at revision: 165
Proposed branch: lp:~mihirsoni/ubuntu-calculator-app/1226738
Merge into: lp:~ubuntu-calculator-dev/ubuntu-calculator-app/old_trunk
Diff against target: 22 lines (+9/-3)
1 file modified
formula.js (+9/-3)
To merge this branch: bzr merge lp:~mihirsoni/ubuntu-calculator-app/1226738
Reviewer Review Type Date Requested Status
Riccardo Padovani Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+188024@code.launchpad.net

Commit message

corrected output of the calculation

Description of the change

This change include following updates :-
if user press 9*= it'll do the the multiplication with last number.
if user press 9+= it'll do the addition with the last number

Above behavior is related to bug #1203435 which we haven't removed it.

If user press 9*5-= calculator will ignore the last sign and will calculate the result as 40. Solution of bug #1226738

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
164. By Mihir Soni

modified the indetation

Revision history for this message
Riccardo Padovani (rpadovani) wrote :

Looks good to me :)
Thanks for the work Mihir!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'formula.js'
--- formula.js 2013-09-24 19:29:44 +0000
+++ formula.js 2013-09-28 08:47:43 +0000
@@ -158,9 +158,15 @@
158 if (isLastResult && !isChangeSign && table[secondLast.type] !== undefined)158 if (isLastResult && !isChangeSign && table[secondLast.type] !== undefined)
159 formula = '(' + formula + ')' + table[secondLast.type] + last.value.toString();159 formula = '(' + formula + ')' + table[secondLast.type] + last.value.toString();
160 // In this case user press a number, and operator (or only an operator, if it isn't the first calc), and then equal160 // In this case user press a number, and operator (or only an operator, if it isn't the first calc), and then equal
161 else if (last.type & T_OPERATOR)161 else if (last.type & T_OPERATOR){
162 formula = formula + secondLast.value.toString();162 //If user is trying to use same numbers
163163 if(formula.length === 2) {
164 formulaPush(secondLast.value.toString())
165 }
166 //if user has not put any number after last sign then ignore it
167 else
168 formulaPop()
169 }
164 result = _calculate(formula);170 result = _calculate(formula);
165171
166 // If user want to change sign to the result172 // If user want to change sign to the result

Subscribers

People subscribed via source and target branches