Here you can find the source of getDoubleForDisplay(Double d)
public static String getDoubleForDisplay(Double d)
//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); } } }