diff --git a/apps/scicalc/ChangeLog b/apps/scicalc/ChangeLog index 5560f00bc..6cce3743a 100644 --- a/apps/scicalc/ChangeLog +++ b/apps/scicalc/ChangeLog @@ -1 +1,2 @@ 0.01: New App! +0.02: Swiping up has now the same effect as hitting the "<" button. diff --git a/apps/scicalc/README.md b/apps/scicalc/README.md index 740b4216b..fe6582361 100644 --- a/apps/scicalc/README.md +++ b/apps/scicalc/README.md @@ -5,7 +5,7 @@ by the JS interpreter. ## Usage -Buttons are arranged on 3 separate screens, swiping left or right switches between them. Swiping down has the same effect as hitting the "=" button. +Buttons are arranged on 3 separate screens, swiping left or right switches between them. Swiping down has the same effect as hitting the "=" button. Swiping up has the same effect as hitting the "<" button. ## Features diff --git a/apps/scicalc/app.js b/apps/scicalc/app.js index 5d914d0c5..078790855 100644 --- a/apps/scicalc/app.js +++ b/apps/scicalc/app.js @@ -69,8 +69,8 @@ function compute() { var res; console.log(processInp(inputStr)); try { res = eval(processInp(inputStr)); } - catch(e) { res = "error"; } - inputStr = res; + catch(e) { res = "error"; } + inputStr = res === undefined ? '' : res; qResult = true; updateDisp(inputStr, 19); } @@ -105,6 +105,11 @@ function swipeHandler(e,d) { if (curPage<0) curPage = buttons.length-1; drawPage(curPage); if (d==1) compute(); + else if (d==-1) { + if (inputStr.length>0) inputStr = inputStr.slice(0, -1); // delete last character + qResult = false; + updateDisp(inputStr, 32); + } } Bangle.on("touch", touchHandler); diff --git a/apps/scicalc/metadata.json b/apps/scicalc/metadata.json index beda619e2..f05d97ec5 100644 --- a/apps/scicalc/metadata.json +++ b/apps/scicalc/metadata.json @@ -1,7 +1,7 @@ { "id": "scicalc", "name": "Scientific Calculator", "shortName":"SciCalc", - "version":"0.01", + "version":"0.02", "description": "Scientific calculator", "icon": "scicalc.png", "screenshots" : [ { "url":"scicalc_screenshot1.png" }, { "url":"scicalc_screenshot2.png" }, { "url":"scicalc_screenshot3.png" } ],