Files
bitburner-src/markdown/bitburner.hacknet.getlevelupgradecost.md

81 lines
1.1 KiB
Markdown

<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Hacknet](./bitburner.hacknet.md) &gt; [getLevelUpgradeCost](./bitburner.hacknet.getlevelupgradecost.md)
## Hacknet.getLevelUpgradeCost() method
Calculate the cost of upgrading hacknet node levels.
**Signature:**
```typescript
getLevelUpgradeCost(index: number, n?: number): number;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
index
</td><td>
number
</td><td>
Index/Identifier of Hacknet Node.
</td></tr>
<tr><td>
n
</td><td>
number
</td><td>
_(Optional)_ Number of levels to upgrade. Must be positive. Will be rounded to the nearest integer. Defaults to 1 if not specified.
</td></tr>
</tbody></table>
**Returns:**
number
Cost of upgrading the specified Hacknet Node.
## Remarks
RAM cost: 0.5 GB
Returns the cost of upgrading the specified Hacknet Node by n levels.
If an invalid value for n is provided, then this function returns 0. If the specified Hacknet Node is already at max level, then Infinity is returned.