Skip to content

Commit

Permalink
Merge pull request #43 from robustus-atrax/fix/decimal-or-floating-po…
Browse files Browse the repository at this point in the history
…int-precision

bug #38 fixed
  • Loading branch information
harsh98trivedi authored Dec 30, 2024
2 parents 9584545 + fae560e commit c334951
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/calc.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,13 @@ function checkForBracketMulti() {
// ... (same code as before)

if (eval(screenValue) !== undefined) {
screen.value = eval(screenValue);
if (!Number.isInteger(eval(screenValue))){
screen.value = eval(screenValue).toFixed(2);
}
else {
screen.value = eval(screenValue);
}

lastScreenValue = screenValue;
screenValue = screen.value;
if (parseFloat(screen.value) < 0) {
Expand Down

0 comments on commit c334951

Please sign in to comment.