/**
* Round the input number to <code>decimalPlaces</code>
*
* @param val
* @param decimalPlaces
* @return
*/
private double roundTo(double val, int decimalPlaces) {
double p = Math.pow(10, decimalPlaces);
val = val * p;
float tmp = Math.round(val);
return tmp / p;
}