I\'m looking for a way to round up a number to the next closest multiple of 250. So for example if I had the following JS:
var containerHeight = $(\"#container\
function NearestMultiple(i, j) {
alert(Math.ceil(i/ j) * j);
}
NearestMultiple(1007, 250); //returns 1250
See example at http://jsfiddle.net/SUya9/1/
Or what James said too!
EDIT: I see you wanted to round up all the time...Updated fiddle, but James got her in 1.
containerHeight = Math.ceil(containerHeight / 250.0) * 250;
simple
var rounded = Math.ceil(value / round) * round;