diff --git a/src/logic/operate.js b/src/logic/operate.js index 0274e3a74..49d2eb9a9 100644 --- a/src/logic/operate.js +++ b/src/logic/operate.js @@ -13,10 +13,10 @@ export default function operate(numberOne, numberTwo, operation) { return one.times(two).toString(); } if (operation === "รท") { - if (two === "0") { + if (two.toString() === "0") { alert("Divide by 0 error"); return "0"; - } else { + } else { return one.div(two).toString(); } }