Skip to content
This repository has been archived by the owner on Jan 18, 2023. It is now read-only.

Commit

Permalink
Issue #25 - Overrides leftmost zero with next non-zero number (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
zoop-ad authored and andrewagain committed May 31, 2019
1 parent b74e245 commit 0b9711e
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 0b9711e

Please sign in to comment.