I need a little help with some Arcade formatting in my attribute rules. I have a valid Arcade expression made to return a number, but I am having some issues with a variable doing a mathematical expression.
The variable InletVolume in the following example is supposed to multiply the variable D by 216, then divide it by 1728 then divide it by 27, but all it will return is 0. I have made sure the If/Else expressions are right, and if I just put it as InletVolume = D it gives the right number, but when I ask it to do any calculation such as D * 10 it just returns a 0. I am guessing that I have the formatting wrong for it, but I have tried everything I can think of with it, adding parenthesis, brackets, etc.
Any help you could provide would be great!
Var StructType = $feature.StructureType
var SubType = $feature.Subtype
var D = $feature.DebrisDepth
var B = $feature.BoxDiamIn
var InletVolume = D * 216 / 1728 / 27
var PrereatVol = (((D * B) / 1728) / 27)
var ManholeVolume = 0
var UntrackedVolume = 0
if (StructType == "SD INLET") {
return InletVolume;
} else if (StructType == "PRE-TREATMENT STRUCTURE") {
return PretreatVol;
} else if (StructType == "SD MANHOLE") {
return ManholeVolume;
} else {
return UntrackedVolume;
}
Solved! Go to Solution.
Possible error sources:
Possible error sources:
Thanks for your help! It turns out that the issue is the second point that you brought up, and I went ahead and changed it over to double with number format to allow 10 decimal places, but it seems to only allow 1 decimal place, and is now returning 0.1 when it should in reality be like .005. Is there something I need to do to allow multiple decimal places in the arcade calculations?
Nevermind, I had the scale for the double set to 1 without knowing it. It is working properly now. I very much appreciate your help!