Java Double Number Format formatDouble(double d)

Here you can find the source of formatDouble(double d)

Description

format Double

License

Open Source License

Declaration

public static String formatDouble(double d) 

Method Source Code

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

public class Main {
    public static String formatDouble(double d) {
        String s = "" + d;
        if (s.endsWith(".0"))
            s = s.substring(0, s.length() - 2);
        return s;
    }/*from   w  w  w .j a  va  2s .  com*/
}

Related

  1. format(double val, int n, int w)
  2. format(double value, int decimalPlaces)
  3. format(double value, int digits)
  4. format(final double power)
  5. formatDouble(double d)
  6. formatDouble(double d)
  7. formatDouble(double d, int n)
  8. formatDouble(double d, int n)
  9. formatDouble(double d, int n, String pad)