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