Here you can find the source of formatDoubleList(List
public static String formatDoubleList(List<Double> list)
//package com.java2s; //License from project: Open Source License import java.text.DecimalFormat; import java.util.List; public class Main { private static DecimalFormat decimalFormat; public static String formatDoubleList(List<Double> list) { return formatDoubleList(list, decimalFormat); }/*from w w w . j av a 2 s . c om*/ public static String formatDoubleList(List<Double> list, DecimalFormat format) { StringBuilder sb = new StringBuilder(); String sep = ""; for (Double d : list) { sb.append(sep); sb.append(format.format(d)); sep = " "; } return sb.toString(); } }