public static String formatDouble(double number,int decimalPlaces){
  doubleUnspecificFormat.setMaximumFractionDigits(decimalPlaces);
  doubleUnspecificFormat.setMinimumFractionDigits(decimalPlaces);
  return doubleUnspecificFormat.format(number);
}

public static String formatDouble ( double number , int decimalPlaces ) { doubleUnspecificFormat . setMaximumFractionDigits ( decimalPlaces ) ; doubleUnspecificFormat . setMinimumFractionDigits ( decimalPlaces ) ; return doubleUnspecificFormat . format ( number ) ; }
formats a double value based on the number of decimal places .
