[1087] is my global list where I have values assigned to each option.
[1098] is my base value which is calculated separately from the if statement.
The way it's currently set up is to use the global list option value to check if it's smaller than my set amount.
What I want to achieve is to check the option ID inside the global list and perform the action relevant to that ID instead of its value because that might be changed in the future.
My current code:
Code: Select all
my_function();
function my_function() {
size = get_value([1087])
if (size < 51) {
return ([1098] * 0.010) + size
}
else if (size < 101) {
return ([1098] * 0.011) + size
}
else if (size < 201) {
return ([1098] * 0.012) + size
}
else if (size < 301) {
return ([1098] * 0.013) + size
}
}
Code: Select all
my_function();
function my_function() {
size = get_value([1087])
if ([1087] = [380]) {
return ([1098] +200) + size
}
else if ([1087] = [381]) {
return ([1098] / 3)
}
else if ([1087] = [382]) {
return ([1098] * 0.012) + size
}
else if ([1087] = [1569]) {
return ([1098] * 0.013) + size
}
}