public static String formatDouble(Double d, int decimals) {
		if (d == null) {
			return "N/A";
		}
		if (decimals == 0) {
			return String.format(Locale.US, "%d", Math.round(d));
		}
		String format = "%." + decimals + "f";
		return String.format(Locale.US, format, d);
	}