protected int calculateCycles(int unitsCycle,BigDecimal qty){
  BigDecimal cycles=qty;
  BigDecimal unitsCycleBD=BigDecimal.valueOf(unitsCycle);
  if (unitsCycleBD.signum() > 0) {
    cycles=qty.divide(unitsCycleBD,0,RoundingMode.UP);
  }
  return cycles.intValue();
}

protected int calculateCycles ( int unitsCycle , BigDecimal qty ) { BigDecimal cycles = qty ; BigDecimal unitsCycleBD = BigDecimal . valueOf ( unitsCycle ) ; if ( unitsCycleBD . signum ( ) > 0 ) { cycles = qty . divide ( unitsCycleBD , 0 , RoundingMode . UP ) ; } return cycles . intValue ( ) ; }
calculate how many cycles are needed for given qty and units per cycle
