Java Number Round roundToNearestMultiple(double number, double multiple)

Here you can find the source of roundToNearestMultiple(double number, double multiple)

Description

round To Nearest Multiple

License

Open Source License

Declaration

public static double roundToNearestMultiple(double number, double multiple) 

Method Source Code

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

Related

  1. roundToNearest(double number)
  2. roundToNearest(int num, int nearest)
  3. roundToNearestEven(int mantissa, int numOfBitsToRoundOff)
  4. roundToNearestInterval(int i, int j)
  5. roundToNearestK(float v, int k)
  6. roundToNearestMultipleOf(final long num, final long multipleOf)
  7. roundToNearestN(float value, float n)
  8. roundToNearestPowerOfTen(double value)
  9. roundToNext(int val, int factor)