Title: Multiple Value Cal.
Last modified: July 10, 2022

---

# Multiple Value Cal.

 *  Resolved [mira404](https://wordpress.org/support/users/mira404/)
 * (@mira404)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/multiple-value-cal/)
 * Hi, I try to build a calculator that has 2 Dropdown fields.
 * 1st field is called: **Club**
    2nd field is called: **Lie**
 * Like this: [https://prnt.sc/ucv7ie7jnSoX](https://prnt.sc/ucv7ie7jnSoX)
 * **Lie** have fixed value (-4, -3, -2, -1, 0, 1, 2, 3, 4).
 * **Club** = dropdown field and it’s has 9 different values for each club. Like**
   wood** has 9 different values and also **wedge** has 9 different values.
 * **Wood**: (0.40, 0.42, 0.32, 0.33, 0.30, 0.31, 0.43, 0.39 and 0.34)
    **Wedge**:(
   0.45, 0.40, 0.37, 0.35, 0.32, 0.31, 0.43, 0.39 and 0.37)
 * **So I need to put 9 club values for each club, like Wood, Wedge, etc.**
 * _For Example:_
 * 1. Select Club= Wood (0.40) and Lie: -4
    2. Select Club= Wood (0.42) and Lie:-
   3 3. Select Club= Wood (0.32) and Lie: -2 4. Select Club= Wood (0.33) and Lie:-
   1 5. Select Club= Wood (0.30) and Lie: 0 6. Select Club= Wood (0.31) and Lie:
   1 7. Select Club= Wood (0.43) and Lie: 2 8. Select Club= Wood (0.39) and Lie:
   3 9. Select Club= Wood (0.34) and Lie: 4
 * **Formula: PREC((club \* lie), 1)**
 * How to set up these calculator club values?
 * Please check the Link to the page you need help with I would build to like that
   calculator.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fmultiple-value-cal%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/multiple-value-cal/#post-15813132)
 * Hello [@mira404](https://wordpress.org/support/users/mira404/)
 * There are different possible implementations to the equation. For example, you
   can use `if` conditional statements:
 *     ```
       (function(){
           var club = fieldname1, lie = fieldname3, v;
   
           if(club == 'Wood')
           {
               switch(lie){
                   case -4: v = 0.40; break;
                   case -3: v = 0.42; break;
                   case -2: v = 0.32; break;
                   case -1: v = 0.33; break;
                   case 0: v = 0.30; break;
                   case 1: v = 0.31; break;
                   case 2: v = 0.43; break;
                   case 3: v = 0.39; break;
                   case 4: v = 0.34; break;
               }
           }
           if(club == 'Wedge')
           {
               /* include the switch block corresponding to the Wedge club */
           }
           return PREC(lie*v, 1);
       })()
       ```
   
 * Best regards.
 *  Thread Starter [mira404](https://wordpress.org/support/users/mira404/)
 * (@mira404)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/multiple-value-cal/#post-15814465)
 * Thanks a lot!
 * I have almost complete the calculator but I have one more thing:
 * If I select the negative value (-) as an input, the output comes to negative 
   then I want to show Increased by [Output]. Like this: [https://prnt.sc/t_5EgfA3xPA7](https://prnt.sc/t_5EgfA3xPA7)
 * If I select the positive value (+) as an input and the output comes to positive,
   I want to show Decrease by [Output]. Like this: [https://prnt.sc/_GXRVowmcOdU](https://prnt.sc/_GXRVowmcOdU)
 * How to do this?
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/multiple-value-cal/#post-15814477)
 * Hello [@mira404](https://wordpress.org/support/users/mira404/)
 * You can edit the following piece of code in the equation:
 * `return PREC(lie*v, 1);`
 * as follows:
 * `return IF(lie*v<0, 'Increased by ', 'Decreased by ') + PREC(lie*v, 1);`
 * Best regards.
 *  Thread Starter [mira404](https://wordpress.org/support/users/mira404/)
 * (@mira404)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/multiple-value-cal/#post-15814545)
 * It’s working. Now show “Increased by” and “Decreased by” so I don’t need to show(-)
   symbol how to remove this? Check: [https://prnt.sc/vFEtZPV8E-ao](https://prnt.sc/vFEtZPV8E-ao)
 * This result is shown in inches.
 * As well as have a centimeter field and the formula is PREC((fieldname9*2.54),
   1) but How I can add “Increased by” and “Decreased by” to this field.
 * Also check this: [https://prnt.sc/Z3ojyJaMGVl0](https://prnt.sc/Z3ojyJaMGVl0)
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/multiple-value-cal/#post-15814566)
 * Hello [@mira404](https://wordpress.org/support/users/mira404/)
 * You can use the ABS operation to get always the positive value:
 * `return IF(lie*v<0, 'Increased by ', 'Decreased by ') + PREC(ABS(lie*v), 1);`
 * Please, note the support service does not cover the implementation of the users’
   projects. We cannot implement your project through the WordPress forum.
 * If you need that us to implement your project, you can contact us through the
   plugin’s website: [Custom Coding Service](https://cff.dwbooster.com/customization)
 * Best regards.
 *  Thread Starter [mira404](https://wordpress.org/support/users/mira404/)
 * (@mira404)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/multiple-value-cal/#post-15814842)
 * Thanks a lot! I solve that

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Multiple Value Cal.’ is closed to new replies.

 * ![](https://ps.w.org/calculated-fields-form/assets/icon-256x256.jpg?rev=1734377)
 * [Calculated Fields Form](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/)

 * 6 replies
 * 2 participants
 * Last reply from: [mira404](https://wordpress.org/support/users/mira404/)
 * Last activity: [3 years, 11 months ago](https://wordpress.org/support/topic/multiple-value-cal/#post-15814842)
 * Status: resolved