public static Vector formatDecimal(Collection c,String pattern){
  DecimalFormat f=new DecimalFormat(pattern);
  Vector v=new Vector();
  for (Iterator i=c.iterator(); i.hasNext(); ) {
    Object o=i.next();
    if (o instanceof Double)     v.add(f.format(o));
 else     v.add(o);
  }
  return v;
}

public static Vector formatDecimal ( Collection c , String pattern ) { DecimalFormat f = new DecimalFormat ( pattern ) ; Vector v = new Vector ( ) ; for ( Iterator i = c . iterator ( ) ; i . hasNext ( ) ; ) { Object o = i . next ( ) ; if ( o instanceof Double ) v . add ( f . format ( o ) ) ; else v . add ( o ) ; } return v ; }
returns a collection of decimals based on the given collection but with the doubles formatted according to the pattern . string values are ignored .
