mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-30 11:33:47 +01:00
Edited formatAbsurdNumber; reinstated parts of formatShares
This commit is contained in:
parent
1b6058dd0a
commit
54114dc6d0
@ -52,7 +52,7 @@ class NumeralFormatter {
|
|||||||
return this.format(n, "0.000a");
|
return this.format(n, "0.000a");
|
||||||
}
|
}
|
||||||
|
|
||||||
formatAbsurdNumber(n: number, decimalPlaces: number): string {
|
formatAbsurdNumber(n: number, decimalPlaces = 3): string {
|
||||||
for(let i = 0; i < extraFormats.length; i++) {
|
for(let i = 0; i < extraFormats.length; i++) {
|
||||||
if(extraFormats[i] < n && n <= extraFormats[i]*1000) {
|
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];
|
||||||
@ -140,6 +140,9 @@ class NumeralFormatter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
formatShares(n: number): string {
|
formatShares(n: number): string {
|
||||||
|
if (n < 1000) {
|
||||||
|
return this.format(n, "0");
|
||||||
|
}
|
||||||
return this.formatAbsurdNumber(n, 3);
|
return this.formatAbsurdNumber(n, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user