Code example for BigDecimal

Methods: subtract

                    return n1.subtract(n2);
                case BIGDECIMAL: {
                    BigDecimal n1 = toBigDecimal(first);
                    BigDecimal n2 = toBigDecimal(second);
                    return n1.subtract(n2);
            // Make the compiler happy. getCommonClassCode() is guaranteed to  
            // return only above codes, or throw an exception. 
            throw new Error();
        public Number multiply(Number first, Number second) throws TemplateException {
            switch(getCommonClassCode(first, second)) {
                case INTEGER: {
                    int n1 = first.intValue();
                    int n2 = second.intValue();
                    int n = n1 * n2;
Connect your IDE to all the code out there  Get Codota for Java