Java Double Number Round round(double number, int decimal)

Here you can find the source of round(double number, int decimal)

Description

round

License

Open Source License

Declaration

public static double round(double number, int decimal) 

Method Source Code

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

public class Main {
    public static double round(double number, int decimal) {
        return Math.round(number * Math.pow(10, decimal))
                / Math.pow(10, decimal);
    }/*from w w  w. j ava 2s.c o  m*/
}

Related

  1. round(double num, int decimal)
  2. round(double num, int numDecs, boolean rawFactor)
  3. round(double num, int precision)
  4. round(double number)
  5. round(double number, double multiplier)
  6. round(double number, int digit)
  7. round(double number, int digits)
  8. round(double number, int places)
  9. round(double number, int places)