1. static public double truncateDecimals(double n, int numberOfDecimals){
  2.        return Math.floor(n*Math.pow(10,numberOfDecimals))/Math.pow(10, numberOfDecimals);
  3. }