Java Double Number Round round(double a)

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

Description

Returns a double rounded to the nearest integer.

License

Open Source License

Parameter

Parameter Description
a double to be rounded

Return

double containing the rounded number.

Declaration

public static double round(double a) 

Method Source Code

//package com.java2s;

public class Main {
    /** Returns a double rounded to the nearest integer.
     * @param a double to be rounded/*  ww  w  .j av a2 s . c o m*/
     * @return double containing the rounded number.
     */
    public static double round(double a) {
        return Math.floor(a + 0.5);
    }
}

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)