fix: Correctly parse leading zeros for decimal input

Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
2026-03-14 14:37:10 -06:00
committed by Tanner
parent 8c7c488967
commit b86f6720bc
+1 -1
View File
@@ -536,7 +536,7 @@ function buttonPress(val) {
if (!swipeEnabled) drawKey('R', specials.R); if (!swipeEnabled) drawKey('R', specials.R);
const is0Negative = (currNumber === 0 && 1/currNumber === -Infinity); const is0Negative = (currNumber === 0 && 1/currNumber === -Infinity);
if (isDecimal) { if (isDecimal) {
currNumber = currNumber == null || hasPressedEquals === 1 ? 0 + '.' + val : currNumber + '.' + val; currNumber = currNumber == null || hasPressedEquals === 1 ? '0.' + val : parseInt(currNumber, 10) + '.' + val;
isDecimal = false; isDecimal = false;
} else { } else {
currNumber = currNumber == null || hasPressedEquals === 1 ? val : (is0Negative ? '-' + val : currNumber + val); currNumber = currNumber == null || hasPressedEquals === 1 ? val : (is0Negative ? '-' + val : currNumber + val);