Number Methods
The Number
object is used to represent numbers, like 3.14
, -10
, or 2022
, and it comes with a handful of methods that’s useful for handling with numbers.
JavaScript treats primitive values as objects when it’s executing methods and properties.
Number Methods
- .isFinite()
- Determines whether the passed value is a finite number.
- .isInteger()
- Determines whether the passed value is an integer.
- .isNaN()
- Determines whether the passed value is NaN.
- .toExponential()
- Converts a number to a string of its exponential form.
- .toFixed()
- Converts a number to a string of its fixed-point decimal form.
- .toLocaleString()
- Converts a date to a string of its language-sensitivie form.
- .toPrecision()
- Converts a number to a string of its specified precision form.
- .toString()
- Converts a number to a string.
All contributors
- garanews209 total contributions
- christian.dinh2481 total contributions
- Anonymous contributorAnonymous contributor3077 total contributions
- garanews
- christian.dinh
- Anonymous contributor
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.