Languages
[Edit]
EN

JavaScript - Math.floor() method example

14 points
Created by:
Root-ssh
178170

The Math.floor() function returns an integer value that is smaller than or equal to the argument - the result of round down operation.  


1. Documentation

Edit
SyntaxMath.floor(number)
Parametersnumber - integer or float number value (primitive value).
Result

Rounded down number value (primitive value).

If number value is equal to NaN it returns NaN.

If number value is equal to -Infinity it returns -Infinity.

If number value is equal to +Infinity it returns +Infinity.

Descriptionfloor is a static method that takes only one parameter and returns a rounded-down value.

2. Rounding with precision down-to n places example

Edit

References

Edit
  1. Floor and ceiling functions - Wikipedia

Alternative titles

  1. JavaScript - Math.floor() documentation with examples
  2. js - Math.floor() method documentation with examples
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

JavaScript - Math documentation (EN)

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join