Fix very large number appearing as NaN

This commit is contained in:
Olivier Gagnon 2021-05-26 14:14:20 -04:00
parent ba4169268c
commit 7fedd1f1f5
5 changed files with 7 additions and 5 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1384,7 +1384,7 @@ function initAugmentations() {
"Even though it contains no weapons, the advance tungsten titanium " + "Even though it contains no weapons, the advance tungsten titanium " +
"alloy increases the users strength to unbelievable levels.<br><br>" + "alloy increases the users strength to unbelievable levels.<br><br>" +
"This augmentation increases the player's strength by 300%.", "This augmentation increases the player's strength by 300%.",
strength_mult: 3, strength_mult: 2.70,
}); });
HydroflameLeftArm.addToFactions(["NWO"]); HydroflameLeftArm.addToFactions(["NWO"]);
if (augmentationExists(AugmentationNames.HydroflameLeftArm)) { if (augmentationExists(AugmentationNames.HydroflameLeftArm)) {

@ -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(1e9)}>Add $1b</button>
<button className="std-button" onClick={this.addMoney(1e12)}>Add $1t</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(1e15)}>Add $1000t</button>
<button className="std-button" onClick={this.addMoney(1e27)}>Add $1e27</button> <button className="std-button" onClick={this.addMoney(1e99)}>Add $1e99</button>
<button className="std-button" onClick={this.upgradeRam}>Upgrade Home Computer's RAM</button> <button className="std-button" onClick={this.upgradeRam}>Upgrade Home Computer's RAM</button>
</div> </div>
<div className="row"> <div className="row">

@ -56,7 +56,9 @@ class NumeralFormatter {
if(Math.abs(n) < 1000) { if(Math.abs(n) < 1000) {
return this.format(n, "$0.00"); return this.format(n, "$0.00");
} }
return this.format(n, "$0.000a"); const str = this.format(n, "$0.000a");
if(str === "$NaNt") return '$'+this.format(n, '0.000e0');
return str;
} }
formatSkill(n: number): string { formatSkill(n: number): string {