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.
|
|
|
|
>
|
2024-11-11 01:27:35 +01:00
|
|
|
> Use alternatives:
|
|
|
|
>
|
|
|
|
> - NS APIs: ns.formatNumber, ns.formatRam, ns.formatPercent
|
|
|
|
>
|
|
|
|
> - JS built-in objects/functions: Intl.NumberFormat, Intl.PluralRules, Intl.Locale, etc.
|
2023-02-21 15:44:18 +01:00
|
|
|
>
|
|
|
|
|
2024-11-11 01:27:35 +01:00
|
|
|
Format a number using the numeral library. This function is deprecated and will be removed in a later version.
|
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
|
|
|
|