public static double round ( double value , int exponent ) { double factor = Math . pow ( 10 , exponent ) ; return Math . round ( value * factor ) / factor ; }
Round the value to the specified exponent