Commit 8a6e341a by neel

Divide by 0 handling

parent b2de58ea
...@@ -114,9 +114,13 @@ public class LeaderCalcServiceImpl implements LeaderCalcService { ...@@ -114,9 +114,13 @@ public class LeaderCalcServiceImpl implements LeaderCalcService {
double TOTAL_NGPA_WNBP_TOTAL = NGPA_Inputs_TOTAL.getDouble("TOTAL_NGPA_WNBP_TOTAL"); double TOTAL_NGPA_WNBP_TOTAL = NGPA_Inputs_TOTAL.getDouble("TOTAL_NGPA_WNBP_TOTAL");
double TOTAL_CASE_SIZE_PER_NOP = NGPA_Inputs_TOTAL.getDouble("TOTAL_CASE_SIZE_PER_NOP"); double TOTAL_CASE_SIZE_PER_NOP = NGPA_Inputs_TOTAL.getDouble("TOTAL_CASE_SIZE_PER_NOP");
NGPA_Inputs_TOTAL.put("TOTAL_NOP_NGPA",
Double.valueOf(TOTAL_NGPA_WNBP_TOTAL) / Double.valueOf(TOTAL_CASE_SIZE_PER_NOP)); if (Double.valueOf(TOTAL_CASE_SIZE_PER_NOP).equals(0.0)) {
NGPA_Inputs_TOTAL.put("TOTAL_NOP_NGPA", 0);
} else {
NGPA_Inputs_TOTAL.put("TOTAL_NOP_NGPA",
Double.valueOf(TOTAL_NGPA_WNBP_TOTAL) / Double.valueOf(TOTAL_CASE_SIZE_PER_NOP));
}
// Neel – 20-Apr-2020 – Tata - Leader calculation – NGPA inputs table end // Neel – 20-Apr-2020 – Tata - Leader calculation – NGPA inputs table end
// Neel – 20-Apr-2020 – Tata - Leader calculation – BAU inputs table start // Neel – 20-Apr-2020 – Tata - Leader calculation – BAU inputs table start
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment