From http://www.w3schools.com (Copyright Refsnes Data)
JavaScript Number Object
The toFixed() method formats a number to use a specified number of decimals.
The number is rounded up, and "0"s are added after the decimal point (if needed), to create the desired length.
| NumberObject.toFixed(num) |
| Parameter | Description |
|---|---|
| num | Required. The number of decimals to use |
ExampleFormat the number 13.3714:
The output of the code above will be: Try it yourself » |
JavaScript Number Object
From http://www.w3schools.com (Copyright Refsnes Data)