Here you can find the source of roundToNearestInterval(int i, int j)
public static int roundToNearestInterval(int i, int j)
//package com.java2s; //License from project: Open Source License public class Main { public static int roundToNearestInterval(int i, int j) { return Math.round(i / j) * j; }//from w ww . j a v a 2 s . c o m }