JavaScript Objects The Number Object- toFixed() - Javascript Objects

What is JavaScript Number - toFixed()?

This method formats the right of the decimal of a number with a specific number of digits.


the syntax of it is as follows −

Parameter Details:

digits − The number of digits to appear after the decimal point.

Return Value:

A string representation of number that does not use exponential notation and has the exact number of digits after the decimal place.


Observe the following example for better understanding.


JavaScript Number Object toFixed() Output

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd Protection Status

Javascript Objects Topics