Java Fraction 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;

import java.text.DecimalFormat;

public class Main {
    private static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat(
            "#.##");
    private static final String FORMAT_DOUBLE_NULL_VALUE = "N/A";

    public static String formatDouble(Double d) {
        return d == null ? FORMAT_DOUBLE_NULL_VALUE : DECIMAL_FORMAT
                .format(d);/*from w  w  w .j  av  a 2 s.c o  m*/
    }
}

Related

  1. formatDouble(DecimalFormat fmt, double value)
  2. formatDouble(Double amount, String format)
  3. formatDouble(double aValue)
  4. formatDouble(double d)
  5. formatDouble(double d)
  6. formatDouble(Double d)
  7. formatDouble(double d)
  8. formatDouble(double d)
  9. formatDouble(Double d)