[Home](./index.md) > [bitburner](./bitburner.md) > [HacknetServersFormulas](./bitburner.hacknetserversformulas.md) > [ramUpgradeCost](./bitburner.hacknetserversformulas.ramupgradecost.md)
## HacknetServersFormulas.ramUpgradeCost() method
Calculate cost of upgrading hacknet server ram.
Signature:
```typescript
ramUpgradeCost(startingRam: number, extraLevels?: number, costMult?: number): number;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| startingRam | number | starting ram |
| extraLevels | number | amount of level of ram to purchase (defaults to 1) |
| costMult | number | player cost reduction (default to 1) |
Returns:
number
The calculated cost.