Java Double Number Round round(double x)

Here you can find the source of round(double x)

Description

round

License

Apache License

Declaration

public static double round(double x) 

Method Source Code

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

public class Main {
    public static double round(double x) {
        return round(x, 1);
    }// w w w .j a v a 2  s.c om

    public static double round(double x, int places) {
        double factor = Math.pow(10, places);
        return Math.round(factor * x) / factor;
    }
}

Related

  1. round(double value, int scalar, int standard)
  2. round(double valueToRound, int numberOfDecimalPlaces)
  3. round(double valueToTruncate, int requiredDecimalPlaces)
  4. round(double what, int howmuch)
  5. round(double x)
  6. round(double x)
  7. round(double x)
  8. round(double x, int numPlaces)
  9. round(double x, int places)