fix: Adjust precision for scientific notation display

This commit is contained in:
2026-03-14 14:19:21 -06:00
committed by Tanner
parent 68aa187f71
commit 739b337135
+1 -1
View File
@@ -286,7 +286,7 @@ function displayOutput(num) {
} }
var numStr = num.toString(); var numStr = num.toString();
if (typeof num === 'number' && (numStr.length > RESULT_MAX_LEN || (num !== 0 && Math.abs(num) < 1e-4))) { if (typeof num === 'number' && (numStr.length > RESULT_MAX_LEN || (num !== 0 && Math.abs(num) < 1e-4))) {
let precision = RESULT_MAX_LEN - 8; let precision = RESULT_MAX_LEN - 5;
if (precision < 0) precision = 0; if (precision < 0) precision = 0;
num = toExponential(num, precision).replace("e", "E"); num = toExponential(num, precision).replace("e", "E");
} else { } else {