diff --git a/calculator/test.js b/calculator/test.js index 7852334..12b114a 100644 --- a/calculator/test.js +++ b/calculator/test.js @@ -199,7 +199,11 @@ const finiteTestNumbers = testNumbers.filter(n => isFinite(n)); // Helper to press a number, handling negatives function pressNumber(n) { - const s = String(n); + let s = String(n); + // If string representation is in scientific notation, convert to decimal string + if (s.includes('e')) { + s = n.toFixed(20).replace(/0+$/, '').replace(/\.$/, ''); + } if (s.startsWith('-')) { press(s.substring(1)); buttonPress('N');