Java Double Number Round round(double amt, int digits)

Here you can find the source of round(double amt, int digits)

Description

round

License

Apache License

Declaration

public static double round(double amt, int digits) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static double round(double amt) {
        return ((double) Math.round(100 * amt) / 100);
    }/*from   w ww .j a va  2s. c  o  m*/

    public static double round(double amt, int digits) {
        return (Math.round(Math.pow(10, digits) * amt)) / Math.pow(10, digits);
    }
}

Related

  1. round(double a, double precision)
  2. round(double a, int cutOfDigits)
  3. round(double a, int decimal)
  4. round(double a, int rounding_style)
  5. round(double amount)
  6. round(double d)
  7. round(double d)
  8. round(double d)
  9. round(double d)