fix sleeve memory bug

This commit is contained in:
Olivier Gagnon
2021-09-08 23:47:34 -04:00
parent bada8a5f39
commit 2a13db39c7
360 changed files with 5424 additions and 15764 deletions
+2 -6
View File
@@ -60,18 +60,14 @@ class NumeralFormatter {
if (n === Infinity) return "∞";
for (let i = 0; i < extraFormats.length; i++) {
if (extraFormats[i] < n && n <= extraFormats[i] * 1000) {
return (
this.format(n / extraFormats[i], "0." + "0".repeat(decimalPlaces)) +
extraNotations[i]
);
return this.format(n / extraFormats[i], "0." + "0".repeat(decimalPlaces)) + extraNotations[i];
}
}
if (Math.abs(n) < 1000) {
return this.format(n, "0." + "0".repeat(decimalPlaces));
}
const str = this.format(n, "0." + "0".repeat(decimalPlaces) + "a");
if (str === "NaNt")
return this.format(n, "0." + " ".repeat(decimalPlaces) + "e+0");
if (str === "NaNt") return this.format(n, "0." + " ".repeat(decimalPlaces) + "e+0");
return str;
}