Example usage for java.math BigDecimal subtract

List of usage examples for java.math BigDecimal subtract

Introduction

In this page you can find the example usage for java.math BigDecimal subtract.

Prototype

public BigDecimal subtract(BigDecimal subtrahend) 

Source Link

Document

Returns a BigDecimal whose value is (this - subtrahend) , and whose scale is max(this.scale(), subtrahend.scale()) .

Usage

From source file:com.autentia.intra.bean.billing.FinancialRatioBean.java

public BigDecimal getTotalOurResourcesVar2() {
    try {/*  ww  w. j  a  v a2s.  c o  m*/
        BigDecimal res = new BigDecimal(financialRatio.getTotalOurResources().doubleValue());
        res = res.divide(financialRatioCompTwo.getReserves(), 4, RoundingMode.HALF_UP);
        res = res.subtract(new BigDecimal(1));
        return res;

    } catch (Exception e) {
        return new BigDecimal(0);
    }
}

From source file:com.autentia.intra.bean.billing.FinancialRatioBean.java

public BigDecimal getBanksAccountsVar1() {
    try {//from w w w.  j a va 2  s  .com
        BigDecimal res = new BigDecimal(financialRatio.getBanksAccounts().doubleValue());
        res = res.divide(financialRatioCompOne.getBanksAccounts(), 4, RoundingMode.HALF_UP);
        res = res.subtract(new BigDecimal(1));
        return res;

    } catch (Exception e) {
        return new BigDecimal(0);
    }
}

From source file:com.autentia.intra.bean.billing.FinancialRatioBean.java

public BigDecimal getBanksAccountsVar2() {
    try {//w w  w .  ja  va 2 s  . c  o  m
        BigDecimal res = new BigDecimal(financialRatio.getBanksAccounts().doubleValue());
        res = res.divide(financialRatioCompTwo.getBanksAccounts(), 4, RoundingMode.HALF_UP);
        res = res.subtract(new BigDecimal(1));
        return res;

    } catch (Exception e) {
        return new BigDecimal(0);
    }
}

From source file:com.autentia.intra.bean.billing.FinancialRatioBean.java

public BigDecimal getAmortizationsVar1() {
    try {/*  w w w.  ja  v  a2  s. c o m*/
        BigDecimal res = new BigDecimal(financialRatio.getAmortizations().doubleValue());
        res = res.divide(financialRatioCompOne.getAmortizations(), 4, RoundingMode.HALF_UP);
        res = res.subtract(new BigDecimal(1));
        return res;

    } catch (Exception e) {
        return new BigDecimal(0);
    }
}

From source file:com.autentia.intra.bean.billing.FinancialRatioBean.java

public BigDecimal getAmortizationsVar2() {
    try {/* w w  w  .java  2s. co m*/
        BigDecimal res = new BigDecimal(financialRatio.getAmortizations().doubleValue());
        res = res.divide(financialRatioCompTwo.getAmortizations(), 4, RoundingMode.HALF_UP);
        res = res.subtract(new BigDecimal(1));
        return res;

    } catch (Exception e) {
        return new BigDecimal(0);
    }
}

From source file:com.autentia.intra.bean.billing.FinancialRatioBean.java

public BigDecimal getObligationBondVar1() {
    try {//www  .  j  av a  2s. c  o m
        BigDecimal res = new BigDecimal(financialRatio.getObligationBond().doubleValue());
        res = res.divide(financialRatioCompOne.getObligationBond(), 4, RoundingMode.HALF_UP);
        res = res.subtract(new BigDecimal(1));
        return res;

    } catch (Exception e) {
        return new BigDecimal(0);
    }
}

From source file:com.autentia.intra.bean.billing.FinancialRatioBean.java

public BigDecimal getObligationBondVar2() {
    try {/*w w w .  ja v  a  2 s  . c  o  m*/
        BigDecimal res = new BigDecimal(financialRatio.getObligationBond().doubleValue());
        res = res.divide(financialRatioCompTwo.getObligationBond(), 4, RoundingMode.HALF_UP);
        res = res.subtract(new BigDecimal(1));
        return res;

    } catch (Exception e) {
        return new BigDecimal(0);
    }
}

From source file:com.autentia.intra.bean.billing.FinancialRatioBean.java

public BigDecimal getTotalLiabilityVar1() {
    try {//w w w  . j a  va 2  s .  co  m
        BigDecimal res = new BigDecimal(financialRatio.getTotalLiability().doubleValue());
        res = res.divide(financialRatioCompOne.getTotalLiability(), 4, RoundingMode.HALF_UP);
        res = res.subtract(new BigDecimal(1));
        return res;

    } catch (Exception e) {
        return new BigDecimal(0);
    }
}

From source file:com.autentia.intra.bean.billing.FinancialRatioBean.java

public BigDecimal getTotalLiabilityVar2() {
    try {//  w ww.j a v  a 2s. c  o  m
        BigDecimal res = new BigDecimal(financialRatio.getTotalLiability().doubleValue());
        res = res.divide(financialRatioCompTwo.getTotalLiability(), 4, RoundingMode.HALF_UP);
        res = res.subtract(new BigDecimal(1));
        return res;

    } catch (Exception e) {
        return new BigDecimal(0);
    }
}

From source file:com.autentia.intra.bean.billing.FinancialRatioBean.java

public BigDecimal getInfrastructuresVar1() {
    try {/*from   w w w .  j  av  a2 s. c o m*/
        BigDecimal res = new BigDecimal(financialRatio.getInfrastructures().doubleValue());
        res = res.divide(financialRatioCompOne.getInfrastructures(), 4, RoundingMode.HALF_UP);
        res = res.subtract(new BigDecimal(1));
        return res;

    } catch (Exception e) {
        return new BigDecimal(0);
    }
}