code: public static double truncate(double value, int places) {
  	    if (places < 0) {
  	        throw new IllegalArgumentException();
  	    }
  
  	    long factor = (long) java.lang.Math.pow(10, places);
  	    value = value * factor;
  	    long tmp = (long) value;
  	    return (double) tmp / factor;
  	}
docs: Truncates a value
  @param value - value to be truncated
  @param places - decimal places
  @return