Here you can find the source of roundToNearestMultiple(double number, double multiple)
public static double roundToNearestMultiple(double number, double multiple)
//package com.java2s; //License from project: Open Source License public class Main { public static double roundToNearestMultiple(double number, double multiple) { return (int) (number / multiple) * multiple; }// w w w . j a va 2 s . co m }