Number.prototype.toFixed

Returns a string representing a number in fixed-point notation, rounded to the specified number of digits after the decimal point.

Syntax

toFixed(fractionDigits?)

Parameters

Return value

A string.

Examples

(12345.6789).toFixed()
"12346"
(12345.6789).toFixed(2)
"12345.68"