Skip to content

Commit

Permalink
Issue andrewagain#25 - Overrides leftmost zero with next non-zero number
Browse files Browse the repository at this point in the history
  • Loading branch information
Aditya Sharma authored and Aditya Sharma committed May 27, 2019
1 parent b74e245 commit aa0bff3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/logic/calculate.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ export default function calculate(obj, buttonName) {
}
// If there is no operation, update next and clear the value
if (obj.next) {
const next = obj.next === "0" ? buttonName : obj.next + buttonName;
return {
next: obj.next + buttonName,
next,
total: null,
};
}
Expand Down

0 comments on commit aa0bff3

Please sign in to comment.