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 getExpensesVar1() {
    try {/*www  . jav  a 2  s  .  c  om*/
        BigDecimal res = new BigDecimal(financialRatio.getExpenses().doubleValue());
        res = res.divide(financialRatioCompOne.getExpenses(), 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 getExpensesVar2() {
    try {//from  w w  w.  ja  v a 2s . c o m
        BigDecimal res = new BigDecimal(financialRatio.getExpenses().doubleValue());
        res = res.divide(financialRatioCompTwo.getExpenses(), 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 getCustomersVar1() {
    try {//from   w  ww  .j  a  va2s .  c o  m
        BigDecimal res = new BigDecimal(financialRatio.getCustomers().doubleValue());
        res = res.divide(financialRatioCompOne.getCustomers(), 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 getCustomersVar2() {
    try {//  ww  w .  ja v a  2 s  .co  m
        BigDecimal res = new BigDecimal(financialRatio.getCustomers().doubleValue());
        res = res.divide(financialRatioCompTwo.getCustomers(), 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 getTotalAssetVar1() {
    try {/*  w ww.  j av a 2s .c  o  m*/
        BigDecimal res = new BigDecimal(financialRatio.getTotalAsset().doubleValue());
        res = res.divide(financialRatioCompOne.getTotalAsset(), 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 getTotalAssetVar2() {
    try {//from w ww  .  j a  va  2 s  .  c  om
        BigDecimal res = new BigDecimal(financialRatio.getTotalAsset().doubleValue());
        res = res.divide(financialRatioCompTwo.getTotalAsset(), 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 v a  2  s . co  m*/
        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 {//from www .  j av a  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. j a va  2s  .  com*/
        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 {/*from  www.  j  a  v  a2  s.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);
    }
}