Javascript small and medium numbers take up integers, down integers, rounding up integer implementation (must be read), js decimal
Js small and medium numbers are rounded up to an integer, down to an integer, rounding to an integer.
1. ceil () Up------------- Ceil: ceiling ----------- is on
2. floor () Down------------- Ceil: Ground ----------- is under
3. round () Rounding------------- Ceil: About ----------- is nearby
The following example shows the result at a glance. The printed result is shown below the code.
Math. floor (3/4)
0
Math. floor (1/4)
0
Math. ceil (1/4)
1
Math. ceil (3/4)
1
Math. round (3/4)
1
Math. round (1/4)
0
In this js section, the small and medium numbers are rounded up and rounded down to an integer. The implementation of rounding them to an integer (this article is required) is all the content shared by the editor. I hope to give you a reference, we also hope that you can support the customer's home.