• Resolved lowercas3

    (@lowercas3)


    Hello I previously used this to calculate the sum of a sequence of numbers.

    (function(){ var list = fieldname123|r.replace(/[^\.\d\,]/g,”).split(‘,’), count = list.length; return SUM(list, function(x){return POW(x,2);})/count; })()

    Is there anything similar to calculate the product of a sequence?

    For instance a*b*c…

    Thank you

Viewing 1 replies (of 1 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @lowercas3

    In this case, you must walk the array of values.

    
    (function(){ 
        var list = fieldname123|r.replace(/[^\.\d\,]/g,'').split(','), 
            result = IF(list.length, 1, 0); 
        for(var i in list) result *= list[i];
        return result;
    })()

    Best regards.

Viewing 1 replies (of 1 total)
  • The topic ‘Product of a sequence of numbers’ is closed to new replies.