How can I round a number entered into a text box and divided by 18, UP regardless of whether its below the .5 (with Javascript/jQuery). Currently I am using:
nopallets=parseInt(howmany/18);
But this rounds either down or up depending on which integer it is closest to.
Any help greatly appreciated.
Math.ceil(howmany/18)is what you want.MDN Docs ceil returns the smallest integer greater than or equal to a number.