• Resolved helloplanetat

    (@helloplanetat)


    Hey there,

    Is there a mathematical formula for the following problem: I want to calculate the hiking time. For this, one inputs the elevation gain (field 1) and the distance (field 2). It is assumed that one can cover 300 meters of elevation and 3 km of distance per hour. The formula for calculating the travel time is: divide the elevation gain by 300 and the distance by 3. Then take the smaller value and divide it by 2. Then add the two values together. I need a formula for this. How could this be entered?

    all the best,

    Daniel

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @helloplanetat

    Thank you very much for using our plugin. I don’t know the values you want to sum in “Then add the two values together”. But if you are referring to summing the min_value/2+max_value

    Assuming the input fields in your form are:

    Elevation gain, fieldname1
    Distance, fieldname2

    And the equation in the calculated field:

    
    (function(){
    let v1 = fieldname1/300,
    v2 = fieldname2/3;
    
    return MIN(v1,v2)/2+MAX(v1,v2);
    })()
    

    However, if you are referring to min_value/2+min_value, the equation would be:

    MIN(fieldname1/300,fieldname2/3)*1.5

    Best regards.

    Thread Starter helloplanetat

    (@helloplanetat)

    Thanks that worked perfectly ??

    One more question: How can i change the font family of the form?

    All the best,

    Daniel

    Thread Starter helloplanetat

    (@helloplanetat)

    And is there a way do display max. 2 decimals in the “calculated field”? Thx ??

    Plugin Author codepeople

    (@codepeople)

    Hello @helloplanetat

    The “Customize Form Design” attribute in the “Form Settings” tab is a CSS editor with syntax highlighting and errors check. It allows you to customize the form and fields’ appearance. For example, if you want to modify the form font-family, you can enter the style definition below (or similar) through the “Customize Form Design”:

    #fbuilder *{font-family: Arial, Helvetica, sans-serif !important;}

    Learn more about the form and fields customization by reading the following blog post:

    https://cff.dwbooster.com/blog/2020/01/12/form-design

    Best regards.

    Plugin Author codepeople

    (@codepeople)

    Hello @helloplanetat

    You can use the PREC operation as the outermost operation in the equation:

    PREC(X, Y) round the number X with Y decimals:

    Ex.

    PREC(MIN(fieldname1/300,fieldname2/3)*1.5, 2)

    or

    (function(){
    let v1 = fieldname1/300,
    v2 = fieldname2/3;
    
    return PREC(MIN(v1,v2)/2+MAX(v1,v2), 2);
    })()

    Best regards.

    Thread Starter helloplanetat

    (@helloplanetat)

    Thanks for the awesome support!

    One last question: Is there any way to display a Number as a time. So f.ex. 3,75 becomes 3:45?

    thank you so very much for this awesome plugin <3

    Plugin Author codepeople

    (@codepeople)

    Hello @helloplanetat

    Please look at the DECIMALTOTIME operation in the plugin documentation:

    https://cff.dwbooster.com/documentation#datetime-module

    But please note you must enter valid decimal values (3.75 not 3,75):

    DECIMALTOTIME( 3.75, 'h', 'hh:ii' )

    Best regards.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Formula Question’ is closed to new replies.