Java Double Number Format format(double value, int digits)

Here you can find the source of format(double value, int digits)

Description

format

License

Apache License

Declaration

public static double format(double value, int digits) 

Method Source Code

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

public class Main {
    public static double format(double value, int digits) {
        if (digits < 0) {
            return value;
        }/*from w  w w.ja v a  2 s  .  c  o  m*/
        return Double.valueOf(String.format("%." + digits + "f", value));
    }
}

Related

  1. format(double number, int nums)
  2. format(double number, int precision)
  3. format(double size, String type)
  4. format(double val, int n, int w)
  5. format(double value, int decimalPlaces)
  6. format(final double power)
  7. formatDouble(double d)
  8. formatDouble(double d)
  9. formatDouble(double d)