public static double scaleValue ( double value , int decimals ) { BigDecimal bd = BigDecimal . valueOf ( value ) ; return bd . setScale ( decimals , RoundingMode . HALF_UP ) . doubleValue ( ) ; }
Scales a double value with decimals