BUGFIX: Corrected error in formatReallyBigNumber and updated BB UI to be more large number friendly (#331)

This commit is contained in:
Zelow79
2023-01-20 08:06:50 -05:00
committed by GitHub
parent ac8ea6b5ef
commit d6a0d5fcaa
3 changed files with 24 additions and 19 deletions
+3 -3
View File
@@ -61,7 +61,7 @@ class NumeralFormatter {
const nAbs = Math.abs(n as number);
if (n === Infinity) return "∞";
for (let i = 0; i < extraFormats.length; i++) {
if (extraFormats[i] < nAbs && nAbs <= extraFormats[i] * 1000) {
if (extraFormats[i] <= nAbs && nAbs < extraFormats[i] * 1000) {
return this.format((n as number) / extraFormats[i], "0." + "0".repeat(decimalPlaces)) + extraNotations[i];
}
}
@@ -152,11 +152,11 @@ class NumeralFormatter {
}
formatPopulation(n: number): string {
return this.format(n, "0.000a");
return this.formatReallyBigNumber(n);
}
formatStamina(n: number): string {
return this.format(n, "0.0");
return this.formatReallyBigNumber(n);
}
formatShares(n: number): string {