There are many ways to do this, but here you can choose two styles:
List<Double> ds = new ArrayList<Double>(); // fill ds with Doubles List<String> strings = new ArrayList<String>(); for (Double d : ds) { // Apply formatting to the string if necessary strings.add(d.toString()); }
But the cooler way to do this is to use the modern collection API (my favorite Guava ) and make it into a more functional style:
List<String> strings = Lists.transform(ds, new Function<Double, String>() { @Override public String apply(Double from) { return from.toString(); } });
source share