Java Double Number Round round(double d, int precision)

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

Description

round

License

Open Source License

Declaration

private static double round(double d, int precision) 

Method Source Code

//package com.java2s;

public class Main {
    private static double round(double d, int precision) {
        int temp = (int) ((d * Math.pow(10, precision)));
        return (((double) temp) / Math.pow(10, precision));
    }/* ww  w  . j  a  va  2 s  .  c  om*/
}

Related

  1. round(double d, int decimalPlacesRequired)
  2. round(double d, int decimals)
  3. round(double d, int i)
  4. round(double d, int numDecimal)
  5. round(double d, int p)
  6. Round(double d, int Rpl)
  7. round(double dValue)
  8. round(double input)
  9. round(double input, double step)