Here you can find the source of round_nearestmultipleof5(double value)
public static Double round_nearestmultipleof5(double value)
//package com.java2s; //License from project: Open Source License public class Main { public static Double round_nearestmultipleof5(double value) { if (value % 5 == 0) { return value; } else if (value % 5 < 2.5) { return value - value % 5; } else {/* www .j a v a2 s . co m*/ return value + (5 - value % 5); } } }