Jquery rounds up and down for paging queries

  • 2020-03-30 03:53:45
  • OfStack

When paging queries with ajax, the number of pages is the integer function


<script language="javascript"> 
var uu=Math.floor(5.36) //If I round it down, I get 5
var uu=Math.floor(5.88) //The results of 5
Math.ceil(5.33) //If I round up, I get 6
Math.round(5.55) //I'll round it to 6
math.round(5.22) //The results of 5
</script>

Related articles: