• Resolved larsgj

    (@larsgj)


    Hi

    Im trying to set up a calculation for shipping weight.

    A standard box can hold 16 kg. So the bane is ?standard box? and value is 16. The items to be packed in the boxes weighs 100 kg. 100 kg / 16 gives 7 boxes. Now the box itself has a gross weight of 0,2 kg. So 0,2 kg should be the second value. 7 x 0,2 = 1,4 kg. Total shipping weight then becomes 100 + 1,4. Is this possible to acchieve?

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

    (@codepeople)

    Hello @larsgj

    Yes of course, and it is very straightforward.

    Assuming there is a number field (fieldname1) in the form to allow the user entering the items weight, and you want to include a field to determine the final shipping weight. In this case the equation associated to the calculated field would be:

    
    (function(){
    var box = CEIL(fieldname1/16);
    return fieldname1+box*0.2;
    })()
    

    or even simpler:

    
    fieldname1+CEIL(fieldname1/16)*0.2
    

    and that’s all.
    Best regards.

Viewing 1 replies (of 1 total)
  • The topic ‘Drop down list with two values?’ is closed to new replies.