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:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user