Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize Division in javascript

2025-03-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article is about how to implement division in javascript. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

1. NaN returns the Operand of NaN.

2. Divide infinity by infinity and return NaN.

3. 0 divided by 0 returns NaN, infinity divided by 0, infinite returns, finite number divided by 0 returns infinity.

4. Convert Number (a) into operation instead of numeric value.

Example

I recently made a paged user control that uses division in js. The arrangement is as follows.

Math.ceil (); rounding up, such as Math.ceil (3xpx2) = 2thumb Math.rounds (); rounding down, such as Math.floor (3ax 2) = 1smath Math.round (); rounding up, such as Math.round (3lap 2) = 2bot Math.round (5lap 2) = 2

At the same time, some methods of getting Store in ExtJs are also used:

App.Store1.pageSize; gets the page size in the current Store; App.Store1.currentPage; gets the current page number in the current Store; App.Store1.totalCount; gets all the numbers in the current Store; thank you for reading! This is the end of this article on "how to achieve division in javascript". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 233

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report