public static final double round(double value, double precision)
   {
      precision = Math.pow(10, precision);
      return Math.round(value * precision) / precision;
   }
public static final double round ( double value , double precision ) { precision = Math . pow ( 10 , precision ) ; return Math . round ( value * precision ) / precision ; }
Utility method used to round a double to the given precision.

@param value value to truncate
@param precision Number of decimals to round to.
@return double value