Java Double Number Round round(double value, double precision)

Here you can find the source of round(double value, double precision)

Description

rounding with decimal precision

License

Open Source License

Declaration

public static double round(double value, double precision) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2010 BSI Business Systems Integration AG.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors://from w w  w.  j a  va  2s  .co m
 *     BSI Business Systems Integration AG - initial API and implementation
 ******************************************************************************/

public class Main {
    /**
     * rounding with decimal precision
     */
    public static double round(double value, double precision) {
        return Math.round(value / precision) * precision;
    }
}

Related

  1. round(double value)
  2. round(double value)
  3. round(double value, double decimalplaces)
  4. round(double value, double factor)
  5. round(double value, double increment)
  6. round(double value, int decimal)
  7. round(double value, int decimal)
  8. round(double value, int decimalPlace)
  9. round(double value, int decimalPlaces)