mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-18 05:33:54 +01:00
Hotfix very large number to extend kmbt with qQsSon.
This commit is contained in:
parent
9d1e132d11
commit
f14f65814a
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
@ -716,7 +716,7 @@ class DevMenuComponent extends Component {
|
||||
<button className="std-button" onClick={this.addMoney(1e9)}>Add $1b</button>
|
||||
<button className="std-button" onClick={this.addMoney(1e12)}>Add $1t</button>
|
||||
<button className="std-button" onClick={this.addMoney(1e15)}>Add $1000t</button>
|
||||
<button className="std-button" onClick={this.addMoney(1e99)}>Add $1e99</button>
|
||||
<button className="std-button" onClick={this.addMoney(1e25)}>Add $1e99</button>
|
||||
<button className="std-button" onClick={this.upgradeRam}>Upgrade Home Computer's RAM</button>
|
||||
</div>
|
||||
<div className="row">
|
||||
|
@ -53,6 +53,15 @@ class NumeralFormatter {
|
||||
}
|
||||
|
||||
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) {
|
||||
return this.format(n, "$0.00");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user