I thought this would be simple, but I just cant seem to get it to work.
only allow numbers. Need to check for nil / NAN
if val < 0
val = 0
current_item.product.v1 = checkValue(values[:val1])
current_item.product.v2 = checkValue(values[:val2])
but when I run the code, nothing is ever returned from the checkValue
function. If I remove the function call and just have values[:val1]
things work fine.
Ive also tried removing the return and just having ‘val’ as the last
function line, but I get the same result. I tried placing this function
in a helper file and in the same file that the other code is in, but no