Java Double Number Round round(final Double value)

Here you can find the source of round(final Double value)

Description

round

License

Open Source License

Declaration

public static Double round(final Double value) 

Method Source Code

//package com.java2s;
/*//w w w  .ja  va 2 s.  co  m
 * polymap.org Copyright 2013 Polymap GmbH. All rights reserved.
 * 
 * This is free software; you can redistribute it and/or modify it under the terms of
 * the GNU Lesser General Public License as published by the Free Software
 * Foundation; either version 2.1 of the License, or (at your option) any later
 * version.
 * 
 * This software 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 Lesser General Public License for more details.
 */

public class Main {
    public static Double round(final Double value) {
        if (value != null) {
            return Math.floor(value.doubleValue() + 0.5d);
        }
        return value;
    }
}

Related

  1. round(final double numberToRound, final int decimalPlaces)
  2. round(final double v)
  3. round(final double val, final int decimalPlaces)
  4. round(final double val, final int decimals)
  5. round(final Double value)
  6. round(final double value, final int numDecimals)
  7. round(final double x, final int digits)
  8. round2(double d)
  9. round2(double num)