Skip to content

Latest commit

 

History

History
42 lines (27 loc) · 1.04 KB

bitburner.ns.nformat.md

File metadata and controls

42 lines (27 loc) · 1.04 KB

Home > bitburner > NS > nFormat

NS.nFormat() method

Warning: This API is now obsolete.

Use alternatives:

  • NS APIs: ns.formatNumber, ns.formatRam, ns.formatPercent

  • JS built-in objects/functions: Intl.NumberFormat, Intl.PluralRules, Intl.Locale, etc.

Format a number using the numeral library. This function is deprecated and will be removed in a later version.

Signature:

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.