Java Number Round roundToDimensions(int value, int f)

Here you can find the source of roundToDimensions(int value, int f)

Description

Round.

License

Open Source License

Parameter

Parameter Description
value a parameter
f a parameter

Declaration

public static int roundToDimensions(int value, int f) 

Method Source Code

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

public class Main {
    /**/*from ww  w  .  j  ava 2s.  c o m*/
     * Round.
     * 
     * @param value
     * @param f
     * @return
     */
    public static int roundToDimensions(int value, int f) {
        return Math.round(value / f) * f;
    }
}

Related

  1. roundToDecimals(double d, int numberOfDecimalPlaces)
  2. roundToDecimals(double d, int percision)
  3. roundToDecimals(double doubleValue)
  4. roundToDecimals(double input, int places)
  5. roundToDefaultPrecision(final double value)
  6. roundToDimensions(int value, int nearestValue)
  7. roundToEight(long i)
  8. roundToHalf(float x)
  9. roundToInt(double d)