Standard built-ins

Intl.NumberFormat.prototype.format()

Try the free JavaScript compiler

Bound formatting function returning locale-sensitive numeric display text. Supports Number, BigInt and numeric strings in modern implementations; exact output depends on data and options.

Formal Syntax & Structure

javascript syntaxjavascript
formatter.format(value)

Parameters & Attributes

NameTypeDescription
valueNumber | BigInt | StringNumeric value interpreted according to formatter.

Return Value

String

Localized number text.

Working Example

Example Snippetjavascript
console.log(new Intl.NumberFormat("en-US",{useGrouping:false,minimumFractionDigits:2}).format(3));
JavaScript Reference