Java Double Number Format formatDoubleToString(double d)

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

Description

format Double To String

License

Open Source License

Declaration

public static String formatDoubleToString(double d) 

Method Source Code

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

public class Main {
    public static String formatDoubleToString(double d) {
        if (d == (long) d)
            return String.format("%d", (long) d);
        else// ww  w .j  av a 2  s  . com
            return String.format("%s", d);
    }
}

Related

  1. formatDoubleFast(double source, int decimals, int precision, StringBuffer target)
  2. formatDoubleForDecimalPlaces(double d, int decimalcount)
  3. formatDoubleInfinity(Double d)
  4. formatDoublePrecise(double source, int decimals, int precision, StringBuffer target)
  5. formatDoubleToFixedLength(String value, int length)
  6. formatDoubleToString(double n)
  7. formatDoubleWithPadding(String value, int length, char pad)
  8. getFormat(double d)
  9. getFormat(double value)