Java Number Round roundToNearestInterval(int i, int j)

Here you can find the source of roundToNearestInterval(int i, int j)

Description

round To Nearest Interval

License

Open Source License

Declaration

public static int roundToNearestInterval(int i, int j) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static int roundToNearestInterval(int i, int j) {
        return Math.round(i / j) * j;
    }//from  w  ww  . j a v  a 2  s . c  o  m
}

Related

  1. roundToNDigits(double d, int n)
  2. roundToNearest(double d)
  3. roundToNearest(double number)
  4. roundToNearest(int num, int nearest)
  5. roundToNearestEven(int mantissa, int numOfBitsToRoundOff)
  6. roundToNearestK(float v, int k)
  7. roundToNearestMultiple(double number, double multiple)
  8. roundToNearestMultipleOf(final long num, final long multipleOf)
  9. roundToNearestN(float value, float n)