aspdotnet-suresh offers articles and tutorials,csharp dot net, articles and tutorials,VB.NET Articles,Gridview articles,code examples of 2.0 /3.5,AJAX,SQL Server Articles,examples of .net technologies

JavaScript Get Whole Number Division using Math.Ceil function

Dec 11, 2014

Here I will explain how to get whole number division in
JavaScript or jQuery using Math.ceil() method. Math.ceil() method will rounds number upwards to next nearest integer.

In previous articles I explained how to remove row in table using jQuery, jQuery highlight table row and column on mouseover in, jQuery detect caps lock on or not,
jQuery change image on mouseover, jQuery dropdown with images, jQuery Countdown timer script example and many articles relating to jQuery and Now I will explain how to get whole number division in JavaScript or jQuery using math.ceil() method.

Declaration of Math.ceil() method

Generally we will use Math.ceil() method like as shown below

var result = Math.ceil(25 / 4);
alert(result + ", " + div);
If you want to check it in complete example we need to write the code like as shown below


<html xmlns="">
<title>Get Whole Number Division in Javascript</title>
<script type="text/javascript">
function Getdivision() {
var result = Math.ceil(25 / 4);
alert("Result: " + result);
<form id="form1">
<input type="button" value="Click to Get Division Value" onclick="Getdivision()" />
Live Demo

To check live demo try to click on below button to check result of 25 division with 4

If you enjoyed this post, please support the blog below. It's FREE!

Get the latest,, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email.

subscribe by rss Subscribe by RSS subscribe by email Subscribe by Email


Anonymous said...


Give your Valuable Comments

Other Related Posts

© 2015 All Rights Reserved.
The content is copyrighted to Suresh Dasari and may not be reproduced on other websites without permission from the owner.