Skip to content

Commit

Permalink
DOCUMENTATION: Clarify the return descriptions of 'getPurchasedServer…
Browse files Browse the repository at this point in the history
…Cost' and 'getPurchasedServerUpgradeCost' to include the returns for invalid inputs. (#1884)
  • Loading branch information
NagaOuroboros authored Jan 5, 2025
1 parent e3eb084 commit ef87174
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion markdown/bitburner.ns.getpurchasedservercost.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ getPurchasedServerCost(ram: number): number;

number

The cost to purchase a server with the specified amount of ram.
The cost to purchase a server with the specified amount of ram, or returns Infinity if ram is not a valid amount.

## Remarks

Expand Down
2 changes: 1 addition & 1 deletion markdown/bitburner.ns.getpurchasedserverupgradecost.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ getPurchasedServerUpgradeCost(hostname: string, ram: number): number;

number

The price to upgrade.
The price to upgrade or -1 if either input is not valid, i.e. hostname is not the name of a purchased server or ram is not a valid amount.

## Remarks

Expand Down
4 changes: 2 additions & 2 deletions src/ScriptEditor/NetscriptDefinitions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7164,7 +7164,7 @@ export interface NS {
* ns.tprint(`A purchased server with ${ns.formatRam(ram)} costs $${ns.formatNumber(cost)}`);
* ```
* @param ram - Amount of RAM of a potential purchased server, in GB. Must be a power of 2 (2, 4, 8, 16, etc.). Maximum value of 1048576 (2^20).
* @returns The cost to purchase a server with the specified amount of ram.
* @returns The cost to purchase a server with the specified amount of ram, or returns Infinity if ram is not a valid amount.
*/
getPurchasedServerCost(ram: number): number;

Expand Down Expand Up @@ -7214,7 +7214,7 @@ export interface NS {
*
* @param hostname - Hostname of the server to upgrade.
* @param ram - Amount of RAM of the purchased server, in GB. Must be a power of 2 (2, 4, 8, 16, etc.). Maximum value of 1048576 (2^20).
* @returns The price to upgrade.
* @returns The price to upgrade or -1 if either input is not valid, i.e. hostname is not the name of a purchased server or ram is not a valid amount.
*/
getPurchasedServerUpgradeCost(hostname: string, ram: number): number;

Expand Down

0 comments on commit ef87174

Please sign in to comment.