2022-10-21 17:16:00 +02:00
|
|
|
<!-- 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
|
|
|
|
|
2023-02-21 15:44:18 +01:00
|
|
|
> Warning: This API is now obsolete.
|
|
|
|
>
|
|
|
|
> Use ns.formatNumber, formatRam, or formatPercent instead. Will be removed in 2.3.
|
|
|
|
>
|
|
|
|
|
2023-02-11 19:18:50 +01:00
|
|
|
Format a number using the numeral library. This function is deprecated and will be removed in 2.3.
|
2022-10-21 17:16:00 +02:00
|
|
|
|
2023-02-11 19:18:50 +01:00
|
|
|
**Signature:**
|
2022-10-21 17:16:00 +02:00
|
|
|
|
|
|
|
```typescript
|
|
|
|
nFormat(n: number, format: string): string;
|
|
|
|
```
|
|
|
|
|
|
|
|
## Parameters
|
|
|
|
|
|
|
|
| Parameter | Type | Description |
|
|
|
|
| --- | --- | --- |
|
|
|
|
| n | number | Number to format. |
|
2023-02-11 19:18:50 +01:00
|
|
|
| format | string | Formatting options. See http://numeraljs.com/\#format for valid formats. |
|
2022-10-21 17:16:00 +02:00
|
|
|
|
2023-02-11 19:18:50 +01:00
|
|
|
**Returns:**
|
2022-10-21 17:16:00 +02:00
|
|
|
|
|
|
|
string
|
|
|
|
|
|
|
|
Formatted number.
|
|
|
|
|
|
|
|
## Remarks
|
|
|
|
|
|
|
|
RAM cost: 0 GB
|
|
|
|
|
2023-02-11 19:18:50 +01:00
|
|
|
Converts a number into a string with the specified format options. See http://numeraljs.com/\#format for documentation on format strings supported.
|
2022-10-21 17:16:00 +02:00
|
|
|
|
2023-02-11 19:18:50 +01:00
|
|
|
This function is deprecated and will be removed in 2.3.
|
2022-10-21 17:16:00 +02:00
|
|
|
|