Java Double Number Round round_nearestmultipleof5(double value)

Here you can find the source of round_nearestmultipleof5(double value)

Description

rounnearestmultipleof

License

Open Source License

Declaration

public static Double round_nearestmultipleof5(double value) 

Method Source Code

//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);
        }
    }
}

Related

  1. round2(final double arg)
  2. round2(int a, int preserveDigits)
  3. round2Places(Double input)
  4. round5(final double value)
  5. round_double(double d)
  6. roundAndScale(double startValue, int places)
  7. roundAngle(double a, long n)
  8. roundAtDecimals(double number, int deci)
  9. roundAway(double d)