The toFixed number in javascript is used for number formatting by using fixed-point notation. This can be used to format a number with a specific number of digits to the right side of the decimal.
Syntax:
numObj.toFixed([digits])
Parameters:
The number of digits that appear after the decimal point: These numbers have a value between 0 and 20 inclusive and this implementation can support a wide range of values. It will be treated as 0 if this argument is removed.
Return Value:
It will return a string representation of the given number by using the fixed point notation.
Exceptions:
If this method is invoked on an object then it is not a number. Read more
Top comments (0)