mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-30 03:23:48 +01:00
Merge pull request #4188 from quacksouls/doc-stock
DOC: `stock.getPrice()`: typo fixes and update examples
This commit is contained in:
commit
5b699fa19f
26
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
26
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@ -1089,21 +1089,39 @@ export interface TIX {
|
|||||||
getSymbols(): string[];
|
getSymbols(): string[];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the price of a stock
|
* Returns the price of a stock.
|
||||||
*
|
*
|
||||||
* @remarks
|
* @remarks
|
||||||
* RAM cost: 2 GB
|
* RAM cost: 2 GB
|
||||||
* The stock’s price is the average of its bid and ask price.
|
*
|
||||||
|
* The stock’s price is the average of its bid and ask prices. This function requires
|
||||||
|
* that you have the following:
|
||||||
|
*
|
||||||
|
* 1. WSE Account
|
||||||
|
*
|
||||||
|
* 1. TIX API Access
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* ```ts
|
* ```ts
|
||||||
* // NS1
|
* // NS1
|
||||||
* stock.getPrice("FISG");
|
* stock.getPrice("FSIG");
|
||||||
|
*
|
||||||
|
* // Choose the first stock symbol from the array of stock symbols. Get the price
|
||||||
|
* // of the corresponding stock.
|
||||||
|
* var sym = stock.getSymbols()[0];
|
||||||
|
* tprint("Stock symbol: " + sym);
|
||||||
|
* tprint("Stock price: " + stock.getPrice(sym));
|
||||||
* ```
|
* ```
|
||||||
* @example
|
* @example
|
||||||
* ```ts
|
* ```ts
|
||||||
* // NS2
|
* // NS2
|
||||||
* ns.stock.getPrice("FISG");
|
* ns.stock.getPrice("FSIG");
|
||||||
|
*
|
||||||
|
* // Choose the first stock symbol from the array of stock symbols. Get the price
|
||||||
|
* // of the corresponding stock.
|
||||||
|
* const sym = ns.stock.getSymbols()[0];
|
||||||
|
* ns.tprint("Stock symbol: " + sym);
|
||||||
|
* ns.tprint("Stock price: " + ns.stock.getPrice(sym));
|
||||||
* ```
|
* ```
|
||||||
* @param sym - Stock symbol.
|
* @param sym - Stock symbol.
|
||||||
* @returns The price of a stock.
|
* @returns The price of a stock.
|
||||||
|
Loading…
Reference in New Issue
Block a user