## toFixed Method |
Top Previous Next |

Converts a number into a string, keeping a specified number of decimals. ## Syntaxnumber1.toFixed(number2) ## Arguments
## Return ValueThe number as an exponential notation. ## RemarksIf the argument is missing, it is set to 6 digits to represent the exponential value of the given number. if the argument is higher than 21 higher, nulls are added to create the actual decimal length. If the argument is 0, it returns a number which represents the nearest integer of the number (see Math.round()). ## Examplesvar num= 5.85236; var n=num.toExponential(4); // Returns 5.8524 |