Java Double Number Round round(double value, double increment)

Here you can find the source of round(double value, double increment)

Description

round

License

LGPL

Declaration

public static double round(double value, double increment) 

Method Source Code

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

public class Main {
    public static double round(double value, double increment) {
        return Math.round(value / increment) * increment;
    }//w  w  w.  j  av a  2 s.  c  o  m

    public static float round(float value, float increment) {
        return Math.round(value / increment) * increment;
    }

    public static int round(int value, int increment) {
        return Math.round((float) value / increment) * increment;
    }
}

Related

  1. round(double value)
  2. round(double value)
  3. round(double value)
  4. round(double value, double decimalplaces)
  5. round(double value, double factor)
  6. round(double value, double precision)
  7. round(double value, int decimal)
  8. round(double value, int decimal)
  9. round(double value, int decimalPlace)