Title: Formula Question
Last modified: May 9, 2024

---

# Formula Question

 *  Resolved [helloplanetat](https://wordpress.org/support/users/helloplanetat/)
 * (@helloplanetat)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/formula-question-4/)
 * 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](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/formula-question-4/#post-17742646)
 * Hello [@helloplanetat](https://wordpress.org/support/users/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:
 *     ```wp-block-code
       (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:
 *     ```wp-block-code
       MIN(fieldname1/300,fieldname2/3)*1.5
       ```
   
 * Best regards.
 *  Thread Starter [helloplanetat](https://wordpress.org/support/users/helloplanetat/)
 * (@helloplanetat)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/formula-question-4/#post-17743546)
 * Thanks that worked perfectly 🙂
 * One more question: How can i change the font family of the form?
 * All the best,
 * Daniel
 *  Thread Starter [helloplanetat](https://wordpress.org/support/users/helloplanetat/)
 * (@helloplanetat)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/formula-question-4/#post-17743566)
 * And is there a way do display max. 2 decimals in the “calculated field”? Thx 
   🙂
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/formula-question-4/#post-17743575)
 * Hello [@helloplanetat](https://wordpress.org/support/users/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”:
 *     ```wp-block-code
       #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](https://cff.dwbooster.com/blog/2020/01/12/form-design)
 * Best regards.
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/formula-question-4/#post-17743579)
 * Hello [@helloplanetat](https://wordpress.org/support/users/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.
 *     ```wp-block-code
       PREC(MIN(fieldname1/300,fieldname2/3)*1.5, 2)
       ```
   
 * or
 *     ```wp-block-code
       (function(){
       let v1 = fieldname1/300,
       v2 = fieldname2/3;
   
       return PREC(MIN(v1,v2)/2+MAX(v1,v2), 2);
       })()
       ```
   
 * Best regards.
 *  Thread Starter [helloplanetat](https://wordpress.org/support/users/helloplanetat/)
 * (@helloplanetat)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/formula-question-4/#post-17743648)
 * 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](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/formula-question-4/#post-17743705)
 * Hello [@helloplanetat](https://wordpress.org/support/users/helloplanetat/)
 * Please look at the DECIMALTOTIME operation in the plugin documentation:
 * [https://cff.dwbooster.com/documentation#datetime-module](https://cff.dwbooster.com/documentation#datetime-module)
 * But please note you must enter valid decimal values (3.75 not 3,75):
 *     ```wp-block-code
       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.

 * ![](https://ps.w.org/calculated-fields-form/assets/icon-256x256.jpg?rev=1734377)
 * [Calculated Fields Form - AI Form Builder for WordPress - Contact, Payment, Quote, Quiz & More](https://wordpress.org/plugins/calculated-fields-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/calculated-fields-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/calculated-fields-form/)
 * [Active Topics](https://wordpress.org/support/plugin/calculated-fields-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/calculated-fields-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/calculated-fields-form/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [codepeople](https://wordpress.org/support/users/codepeople/)
 * Last activity: [2 years, 4 months ago](https://wordpress.org/support/topic/formula-question-4/#post-17743705)
 * Status: resolved