fix: Adjust precision for scientific notation display
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user