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