mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-27 01:53:48 +01:00
Merge pull request #967 from danielyxie/dev
Hotfix very large number to extend kmbt with qQsSon.
This commit is contained in:
commit
04b57f07a9
2
dist/engine.bundle.js
vendored
2
dist/engine.bundle.js
vendored
File diff suppressed because one or more lines are too long
2
dist/vendor.bundle.js
vendored
2
dist/vendor.bundle.js
vendored
File diff suppressed because one or more lines are too long
@ -53,6 +53,15 @@ class NumeralFormatter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
formatMoney(n: number): string {
|
formatMoney(n: number): string {
|
||||||
|
if(numeral.options.currentLocale === "en") {
|
||||||
|
const extraFormats = [1e15, 1e18, 1e21, 1e24, 1e27, 1e30];
|
||||||
|
const extraNotations = ['q', 'Q', 's', 'S', 'o', 'n'];
|
||||||
|
for(let i = 0; i < extraFormats.length; i++) {
|
||||||
|
if(extraFormats[i] < n && n <= extraFormats[i]*1000) {
|
||||||
|
return '$'+this.format(n/extraFormats[i], '0.000')+extraNotations[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if(Math.abs(n) < 1000) {
|
if(Math.abs(n) < 1000) {
|
||||||
return this.format(n, "$0.00");
|
return this.format(n, "$0.00");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user