• Resolved 120filter

    (@120filter)


    I don’t know if this is possible and my maths skills are letting me down because they don’t exist.

    What I’m failing to acheive is:

    1. User inputs a series of digits between 0 & 10 [eg 2, 7, 4, 9, 8,]
    This will be a variable list. Above, the user has inputted 5 digits. It could be 50 digits].
    2. A simple calculation adding the list would take place [above = 30].
    3. Another calculation would divide this total by the number of digits inputted [in this example it would be 30 divided by 5 = 6]

    The end result would be an average figure based on the list of numbers inputted.

    The big problem is how to input the variable list of numbers (1)
    (2) is a simple addition
    (3) is a simple division but I need to count the of digits inputted: a text count is all i can think of unless the user inputs the numbers seperated by spaces

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter 120filter

    (@120filter)

    Thankyou that worked perfect.
    I can’t seem to get the hang of the using the function language like you do.
    It’s only my second form though.
    Thanks

    Plugin Author codepeople

    (@codepeople)

    Hello @120filter

    It has been a pleasure.

    In the majority of cases, there is not required to implement complex equations, but the yours it is peculiar.

    Best regards.

    Thread Starter 120filter

    (@120filter)

    Me again,

    It works perfect

    However, it treats 10 as 1

    eg 1 2 3 = 6 correct
    eg 1 2 10 = 3 wrong [should be 13]

    I tried adding variations of this
    /^(\d{1,2}|10])$/

    which says numbers comprise one or two digits with max of 10 [ie can’t enter 11]

    But, I think this should go in the text area [which I can’t do] as opposed to the calculation box?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Average input calculation’ is closed to new replies.