JavaScript API

Intl.NumberFormat

Format a numeric amount for display; currency selection does not convert it.

Formal Syntax & Structure

react syntaxreact
new Intl.NumberFormat(locale, options).format(value)

Working Example

Example Snippetreact
new Intl.NumberFormat("en-US", {style:"currency",currency:"USD"}).format(12.5)
React Reference