bitburner-src/markdown/bitburner.ns.growthanalyze.md
omuretsu 4ab29e9c60 Fix minimum corp employee stat
* minEmployeeDecay is now part of CorpConstants and has a value of 10. This replaces Office.minEne/minMor/minHap
* Also removed some unnecessary files in dist/ext for MathJax
* Rebuilt documentation to remove minHap/minMor/minEne from getOffice, and add minEmployeeDecay to corporation.getConstants
2023-01-03 11:55:50 -05:00

59 lines
1.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!-- 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; [growthAnalyze](./bitburner.ns.growthanalyze.md)
## NS.growthAnalyze() method
Calculate the number of grow threads needed to grow a server by a certain multiplier.
<b>Signature:</b>
```typescript
growthAnalyze(host: string, growthAmount: number, cores?: number): number;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| host | string | Hostname of the target server. |
| growthAmount | number | Multiplicative factor by which the server is grown. Decimal form. |
| cores | number | |
<b>Returns:</b>
number
The amount of grow calls needed to grow the specified server by the specified amount.
## Remarks
RAM cost: 1 GB
This function returns the number of “growths” needed in order to increase the amount of money available on the specified server by the specified amount. The specified amount is multiplicative and is in decimal form, not percentage.
Due to limitations of mathematics, this function won't be the true value, but an approximation.
Warning: The value returned by this function isnt necessarily a whole number.
## Example 1
```ts
// NS1:
//For example, if you want to determine how many grow calls you need to double the amount of money on foodnstuff, you would use:
var growTimes = growthAnalyze("foodnstuff", 2);
//If this returns 100, then this means you need to call grow 100 times in order to double the money (or once with 100 threads).
```
## Example 2
```ts
// NS2:
//For example, if you want to determine how many grow calls you need to double the amount of money on foodnstuff, you would use:
const growTimes = ns.growthAnalyze("foodnstuff", 2);
//If this returns 100, then this means you need to call grow 100 times in order to double the money (or once with 100 threads).
```