public static double subAmounts ( final double n1 , final double n2 ) { final BigDecimal b1 = new BigDecimal ( n1 ) ; final BigDecimal b2 = new BigDecimal ( n2 ) ; BigDecimal b3 = b1 . subtract ( b2 ) ; b3 = b3 . setScale ( 3 , BigDecimal . ROUND_HALF_UP ) ; final double result = b3 . doubleValue ( ) ; return result ; }
Sub amounts .