Here you can find the source of round(double value, double increment)
public static double round(double value, double increment)
//package com.java2s; //License from project: LGPL public class Main { public static double round(double value, double increment) { return Math.round(value / increment) * increment; }//w w w. j av a 2 s. c o m public static float round(float value, float increment) { return Math.round(value / increment) * increment; } public static int round(int value, int increment) { return Math.round((float) value / increment) * increment; } }