Example usage for java.math BigDecimal divide

List of usage examples for java.math BigDecimal divide

Introduction

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

Prototype

public BigDecimal divide(BigDecimal divisor, int scale, RoundingMode roundingMode) 

Source Link

Document

Returns a BigDecimal whose value is (this / divisor) , and whose scale is as specified.

Usage

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

public BigDecimal getObligationBondVar1() {
    try {//from   w w  w  .  j a v  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 {/*from  www . ja va  2  s  .  co  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 {/*from   ww  w .  ja  v a 2 s.com*/
        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 w  w. j av a2  s .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  a  v  a  2s  .co  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);
    }
}

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

public BigDecimal getInfrastructuresVar2() {
    try {//from  w  ww  .  ja va 2s .  c o  m
        BigDecimal res = new BigDecimal(financialRatio.getInfrastructures().doubleValue());
        res = res.divide(financialRatioCompTwo.getInfrastructures(), 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 getTotalOurResourcesVar1() {
    try {//  w w w.j  a v  a  2  s .c om
        BigDecimal res = new BigDecimal(financialRatio.getTotalOurResources().doubleValue());
        res = res.divide(financialRatioCompOne.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 getTotalOurResourcesVar2() {
    try {//  w ww .j  a v  a 2 s .c  om
        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 getFinancialExpensesVar1() {
    try {//from www.jav a2  s . c  om
        BigDecimal res = new BigDecimal(financialRatio.getFinancialExpenses().doubleValue());
        res = res.divide(financialRatioCompOne.getFinancialExpenses(), 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 getFinancialExpensesVar2() {
    try {//from   w  w  w.  j a  va  2s .c o  m
        BigDecimal res = new BigDecimal(financialRatio.getFinancialExpenses().doubleValue());
        res = res.divide(financialRatioCompTwo.getFinancialExpenses(), 4, RoundingMode.HALF_UP);
        res = res.subtract(new BigDecimal(1));
        return res;

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