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.

Syntax:

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.

Example:

Observe the following example for better understanding.

Output:

JavaScript Number Object toFixed() Output


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

Javascript Objects Topics