Java Double Number Round round(double d)

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

Description

round

License

Open Source License

Parameter

Parameter Description
d a parameter

Declaration

public static int round(double d) 

Method Source Code

//package com.java2s;
/*//from www.jav a2  s  .  c  o  m
 * Copyright Samuel Halliday 2010
 * 
 * This file is free software: you can redistribute it and/or modify it under the terms of
 * the GNU General Public License as published by the Free Software Foundation, either
 * version 3 of the License, or (at your option) any later version.
 * 
 * This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 * PURPOSE. See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along with this file.
 * If not, see <http://www.gnu.org/licenses/>.
 */

public class Main {
    /**
     * @param d
     * @return
     */
    public static int round(double d) {
        return (int) Math.round(d);
    }
}

Related

  1. round(double a, int cutOfDigits)
  2. round(double a, int decimal)
  3. round(double a, int rounding_style)
  4. round(double amount)
  5. round(double amt, int digits)
  6. round(double d)
  7. round(double d)
  8. round(double d)
  9. round(double d)