public static float roundDecimal(float value,double places){
  double multiplier=Math.pow(10,places);
  value*=multiplier;
  return (float)(Math.round(value) / multiplier);
}

public static float roundDecimal ( float value , double places ) { double multiplier = Math . pow ( 10 , places ) ; value *= multiplier ; return ( float ) ( Math . round ( value ) / multiplier ) ; }
static method to round a float value to the specified number of decimal places
