Java Double Number Round roundDouble(double pDouble, int pPlaces)

Here you can find the source of roundDouble(double pDouble, int pPlaces)

Description

round Double

License

Open Source License

Declaration

public static final double roundDouble(double pDouble, int pPlaces) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static final double roundDouble(double pDouble, int pPlaces) {
        return Math.round(pDouble * Math.pow(10, (double) pPlaces))
                / Math.pow(10, (double) pPlaces);
    }/*  w ww.  j  a v a  2  s .  c  o m*/
}

Related

  1. roundDouble(double d, int decimals)
  2. roundDouble(double d, int place)
  3. roundDouble(double d, int places)
  4. roundDouble(double num, int precision)
  5. roundDouble(double number, int precision)
  6. roundDouble(double val, int precision)
  7. roundDouble(double value)
  8. roundDouble(double value, int afterDecimalPoint)
  9. roundDouble3(double r)