Get the App
SLTechnology News&Howtos  ›  Development  › 

How JS is rounded up

Shulou Source: shulou.com Published: 2022-06-03 04:40:09 10月19日 Update

This article mainly introduces how to integrate JS, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

ParseInt () this method removes the decimal after the decimal point, leaving only the integer part. If the number to be rounded is positive, it is similar to Math.floor (); when it is negative, it is similar to Math.ceil ()

Math.round () is rounded

Math.floor () is rounded down such as Math.floor (1.8) returns 1tsmath. Returns (- 1.8) returns-2

Math.ceil () is rounded up such as Math.ceil (1.8) returns 2bot Math.ceil (- 1.8) returns-1

Thank you for reading this article carefully. I hope the article "how to integrate JS" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Tags: Articles decimal rounding value interest at the same time decimal point integer method more friends knowledge editing industry information information channel part channel quad reference Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Apple Shulou Information MariaDB Linux