Math.ceil(x); //This equals the next whole number after x. X must be a double. //Example use: x = Math.ceil(x); //Now x is equal to x rounded up.