question: public static double roundDouble ( double value , int afterDecimalPoint ) { double mask = Math . pow ( 10.0 , ( double ) afterDecimalPoint ) ; return ( double ) ( Math . round ( value * mask ) ) / mask ; }
target:  Rounds a double to the given number of decimal places.