Java Double Number Round round(double a)

Here you can find the source of round(double a)

Description

round

License

LGPL

Declaration

static public int round(double a) 

Method Source Code

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

public class Main {
    static public int round(double a) {
        return (int) (((a + 0.5) * 10.0) / 10.0);
    }/*from   w w w.  j  a va 2 s .c o m*/

    static public int round(float a) {
        return (int) (((a + 0.5) * 10.0) / 10.0);
    }
}

Related

  1. getRatioString(double n, double d)
  2. round(double a)
  3. Round(double a)
  4. round(double a, double precision)
  5. round(double a, int cutOfDigits)
  6. round(double a, int decimal)
  7. round(double a, int rounding_style)