How to rounding in JavaScript
This article mainly explains "how to integrate in JavaScript". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to integrate in JavaScript".
The method of rounding in JavaScript: 1, rounding down through Math.floor (); 2, rounding up through Math.ceil (); 3, rounding up through Math.round (); 4, rounding through parseInt ().
This article operating environment: windows7 system, javascript1.8.5 version, Dell G3 computer.
How to round it up in JavaScript?
Several methods of JavaScript rounding
Math.floor () rounding down
Math.floor (3.141592654) / / 3
Math.ceil () rounding up
Math.ceil (3.141592654) / / 4
Math.round () is rounded
Math.round (3.141592654) / / 3
ParseInt () removes the decimal point and the decimal point
ParseInt (3.141592654) / / 3
~ convert data to Number type
~ 3.141592654 / / 3 Thank you for your reading. The above is the content of "how to integrate in JavaScript". After the study of this article, I believe you have a deeper understanding of how to integrate in JavaScript, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!