public static double calumRound(double arg, int places) { double tmp = (double) arg * (pow(10,places)); int tmp1 = (int)Math.floor( tmp + 0.5 ); double tmp2 = (double) tmp1 / (pow(10,places)); return tmp2; } public static int pow(int arg, int times){ int ret = 1; for ( int i = 1 ; i <= times ; i++ ) { ret = ret * arg; } return ret; }