Java Number Round roundNumberToDouble(double value, int decimals)

Here you can find the source of roundNumberToDouble(double value, int decimals)

Description

round Number To Double

License

Open Source License

Declaration

public static double roundNumberToDouble(double value, int decimals) 

Method Source Code

//package com.java2s;
//License from project: GNU General Public License 

public class Main {
    public static double roundNumberToDouble(double value, int decimals) {
        return Math.round(value * Math.pow(10, decimals))
                / Math.pow(10, decimals);
    }//  w  ww. j a  v a  2s. co  m
}

Related

  1. roundNumber(double rowNumber, int roundingPoint)
  2. roundNumber(double theNumber, int places)
  3. roundNumber(float input, float rounding)
  4. roundNumber(String n)
  5. roundNumberTo(double value, int decimals)
  6. roundOff(double fraction, int precision)
  7. roundOffAmt(double dAmt)
  8. roundOffFileCount(int fileCount)
  9. roundOffTo2DecPlaces(double val)