Java Decimal Format getDoubleForDisplay(Double d)

Here you can find the source of getDoubleForDisplay(Double d)

Description

get Double For Display

License

Open Source License

Declaration

public static String getDoubleForDisplay(Double d) 

Method Source Code


//package com.java2s;
import java.text.DecimalFormat;

public class Main {
    private static DecimalFormat df = new DecimalFormat("######0.00");

    public static String getDoubleForDisplay(Double d) {

        if (d == null) {
            return "";
        } else if (d == 0) {
            return "";
        } else {//from w ww .j  a  v a  2 s. co  m
            return df.format(d);
        }
    }
}

Related

  1. getDigitNumber(double p)
  2. getDoubleAsString(double value)
  3. getDoubleByNumeric(String valorTexto)
  4. getDoubleDecimalNumber(double d)
  5. getDoubledigit(double f)
  6. getDoubleFromTaxSet(String taxSetValue)
  7. getDoubleWithTwoDecimalDigits(double value)
  8. getDurationString(double duration)
  9. getEngineeringNotation(final double d)