mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-09 17:23:53 +01:00
886 B
886 B
Home > bitburner > NS > getPurchasedServerCost
NS.getPurchasedServerCost() method
Returns the cost to purchase a server with the specified amount of ram.
Signature:
getPurchasedServerCost(ram: number): number;
Parameters
Parameter | Type | Description |
---|---|---|
ram | number | Amount of RAM of a potential purchased server. Must be a power of 2 (2, 4, 8, 16, etc.). Maximum value of 1048576 (2^20). |
Returns:
number
The cost to purchase a server with the specified amount of ram.
Remarks
RAM cost: 0.25 GB
Example
for (i = 1; i <= 20; i++) {
tprint(i + " -- " + getPurchasedServerCost(Math.pow(2, i)));
}