diff --git a/calculator/calculator.app.js b/calculator/calculator.app.js index df5f087..ab23c41 100644 --- a/calculator/calculator.app.js +++ b/calculator/calculator.app.js @@ -292,7 +292,9 @@ function displayOutput(num) { } else { num = numStr; } - num = num.replace("-","- "); // fix padding for '-' + if (num.charAt(0) === '-') { + num = '- ' + num.substr(1); + } g.setFont('7x11Numeric7Seg', 2); if (num.length > RESULT_MAX_LEN) { if (num.indexOf("E") < 0)