Here you can find the source of arrayToString(double d[])
public static String arrayToString(double d[])
//package com.java2s; //License from project: Open Source License import java.text.DecimalFormat; public class Main { public static DecimalFormat df = new DecimalFormat("#,###.##"); public static String arrayToString(double d[]) { String s = ""; for (int i = 0; i < d.length; i++) { s = s + df.format(d[i]);//from ww w . j a v a 2 s . c o m if (i < d.length - 1) s = s + ","; } return s; } }