Java Number Round roundUP(double d)

Here you can find the source of roundUP(double d)

Description

round UP

License

Open Source License

Declaration

public static int roundUP(double d) 

Method Source Code

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

public class Main {
    public static int roundUP(double d) {
        double dAbs = Math.abs(d);
        int i = (int) dAbs;
        double result = dAbs - (double) i;
        if (result == 0.0) {
            return (int) d;
        } else {/*from   w  w w . ja v  a2 s.c o  m*/
            return (int) d < 0 ? -(i + 1) : i + 1;
        }
    }
}

Related

  1. roundToWord(long value)
  2. roundToZero(float x)
  3. roundTwoDecimals(double value)
  4. roundUp(double a)
  5. roundUp(double d)
  6. roundUp(double n)
  7. roundUp(double n, int precision)
  8. roundUp(double val)
  9. roundUp(double val)