Java Number Round roundToMultiple(int value, int divisor)

Here you can find the source of roundToMultiple(int value, int divisor)

Description

round To Multiple

License

Apache License

Declaration

public static int roundToMultiple(int value, int divisor) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static int roundToMultiple(int value, int divisor) {
        int rem = value % divisor;
        if (rem == 0)
            return (value);
        return (value + divisor - rem);
    }/*from w ww.  j  av a 2 s. c  o m*/
}

Related

  1. roundToInt(double d)
  2. roundToInt(double d)
  3. roundToInt(final double d)
  4. roundToInterval(float num, float interval)
  5. roundToMil(double val)
  6. roundToMultiple(int value, int multipleOf)
  7. roundToMultipleXLength(int inLength, int multipler)
  8. roundToN(double d, int n)
  9. roundToNDecimalPlaces(final double in, final int n)