src/main/java/com/rockagen/commons/util/Arith.java
public static double round(final double v,int scale,int roundingMode){
    	   if(scale<0){
               scale=DIV_SCALE;
           }
           if(roundingMode<0){
           	roundingMode=ROUNDING_MODE;
           }
    	BigDecimal b = new BigDecimal(Double.toString(v));
    	BigDecimal one = new BigDecimal("1");
    	return b.divide(one,scale,roundingMode).doubleValue();
    }
public static double round(final double v,int scale,int roundingMode){
    	   if(scale<0){
               scale=DIV_SCALE;
           }
           if(roundingMode<0){
           	roundingMode=ROUNDING_MODE;
           }
    	BigDecimal b = new BigDecimal(Double.toString(v));
    	BigDecimal one = new BigDecimal("1");
    	return b.divide(one,scale,roundingMode).doubleValue();
    }
public static double round ( final double v , int scale , int roundingMode ) { if ( scale < 0 ) { scale = DIV_SCALE ; } if ( roundingMode < 0 ) { roundingMode = ROUNDING_MODE ; } BigDecimal b = new BigDecimal ( Double . toString ( v ) ) ; BigDecimal one = new BigDecimal ( "1" ) ; return b . divide ( one , scale , roundingMode ) . doubleValue ( ) ; }
random
@param v value
@param scale scale,default is {@link #DIV_SCALE}
@param roundingMode default is {@link #ROUNDING_MODE}
@return double
random