bitburner-src/markdown/bitburner.ns.getpurchasedservercost.md
Olivier Gagnon feb0430aff work on doc
2021-10-30 15:46:34 -04:00

40 lines
886 B
Markdown

<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NS](./bitburner.ns.md) &gt; [getPurchasedServerCost](./bitburner.ns.getpurchasedservercost.md)
## NS.getPurchasedServerCost() method
Returns the cost to purchase a server with the specified amount of ram.
<b>Signature:</b>
```typescript
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). |
<b>Returns:</b>
number
The cost to purchase a server with the specified amount of ram.
## Remarks
RAM cost: 0.25 GB
## Example
```ts
for (i = 1; i <= 20; i++) {
tprint(i + " -- " + getPurchasedServerCost(Math.pow(2, i)));
}
```