def total = ((bvInt + tcInt + rrInt + svInt) / sizeInt) * 100;
def totalNull = ((bvInt + tcInt + rrInt) / sizeInt) * 100;
def result;
if(svValue!=null || "None" || "Nil"){
return total;
} else {
return totalNull;
}
Hi there,
It would be good if you can indicate how we can help you with this question. Does the script gives you an error or it is not doing the right calculation?
Cheers,
Mogavenasan
Here is what ended up working:
if (bValue == "null") {bValue = "0"};
if (tValue == "null") {tValue = "0"};
if (rValue == "null") {rValue = "0"};
if (sValue == "null") {sValue = "0"};
if (svValue == "null") {svValue = "0"};
double sizeInt = Integer.parseInt(sValue);
double rInt = Integer.parseInt(rValue);
double tInt = Integer.parseInt(tValue);
double bInt = Integer.parseInt(bValue);
double svInt = Integer.parseInt(svValue);
def total = 0
if (sizeInt == 0) {total = 0}
else {total = ((bInt + tInt + rInt + sInt) / sizeInt) * 100};
return total
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.