mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-21 05:35:45 +01:00
41 lines
1017 B
Markdown
41 lines
1017 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
|
|
[Home](./index.md) > [bitburner](./bitburner.md) > [NS](./bitburner.ns.md) > [nFormat](./bitburner.ns.nformat.md)
|
|
|
|
## NS.nFormat() method
|
|
|
|
> Warning: This API is now obsolete.
|
|
>
|
|
> Use ns.formatNumber, formatRam, or formatPercent instead. Will be removed in 2.3.
|
|
>
|
|
|
|
Format a number using the numeral library. This function is deprecated and will be removed in 2.3.
|
|
|
|
**Signature:**
|
|
|
|
```typescript
|
|
nFormat(n: number, format: string): string;
|
|
```
|
|
|
|
## Parameters
|
|
|
|
| Parameter | Type | Description |
|
|
| --- | --- | --- |
|
|
| n | number | Number to format. |
|
|
| format | string | Formatting options. See http://numeraljs.com/\#format for valid formats. |
|
|
|
|
**Returns:**
|
|
|
|
string
|
|
|
|
Formatted number.
|
|
|
|
## Remarks
|
|
|
|
RAM cost: 0 GB
|
|
|
|
Converts a number into a string with the specified format options. See http://numeraljs.com/\#format for documentation on format strings supported.
|
|
|
|
This function is deprecated and will be removed in 2.3.
|
|
|