• Resolved Maxwell

    (@nimblearchi)


    Hello, is it possible to build a form that can calculate a quantity of several numbers, eg field 1 has a set read-only value, but is multiplied by an enterable number? I’d like to have 5 or so of these fields, and then a sum field but I am not sure how I’d go about this or if it’s possible with this plugin?

    In other words, I’d like something like this:

    Item 1 (5 dollars) | Type quantity here: __
    Item 2 (5 dollars) | Type quantity here: __
    Item 3 (5 dollars) | Type quantity here: __
    Item 4 (5 dollars) | Type quantity here: __
    Item 5 (5 dollars) | Type quantity here: __

    Total: $[each line is calculated and added together here]

    Thank you.

    • This topic was modified 6 years, 6 months ago by Maxwell.
    • This topic was modified 6 years, 6 months ago by Maxwell. Reason: added clarification
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello,

    Assuming that the fields for the quantities are: fieldname1, fieldname2, fieldname3, fieldname4 and fieldname5, as each of them has a price of 5 dollars, the equation associated to the calculated field for the total would be:

    
    (fieldname1+fieldname2+fieldname3+fieldname4+fieldname5)*5
    

    and that’s all.
    Best regards.

    Thread Starter Maxwell

    (@nimblearchi)

    Thank you for the quick support. Hypothetically, if they each have a different dollar amount, how would that look? Would I just add more multipliers?

    Plugin Author codepeople

    (@codepeople)

    Hello @nimblearchi,

    A hypothetical case:

    
    fieldname1*5+fieldname2*3+fieldname3*8+fieldname4*7+fieldname5*5
    

    Or if you have inserted a field in the form for entering the price of each product:

    
    fieldname1*fieldname6+fieldname2*fieldname7+fieldname3*fieldname8+fieldname4*fieldname9+fieldname5*fieldname10
    

    As you can see it is possible to implement the equation you need.

    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Question about incorporating some simple calculation’ is closed to new replies.