Title: Multiplying A Value With A Range
Last modified: September 26, 2017

---

# Multiplying A Value With A Range

 *  Resolved [ckourounis](https://wordpress.org/support/users/ckourounis/)
 * (@ckourounis)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/multiplying-a-value-with-a-range/)
 * Hello,
 * I am looking to multiple my first value with a dropdown field. 2 of my dropdown
   fields have a range (4-8) so when it does the calculations, it isn’t calculated
   at all. How can I display the calculation so it shows the range?
 * Page the calculator is on: [https://inlandempireraw.com/faqs/](https://inlandempireraw.com/faqs/)
 * **Example of a working calculation:**
    Value 1 x Value 2 = Answer Value 1 = 5
   Value 2 = 2% Answer = 0.1
 * **Example of a non-working calculation:**
    Value 1 = 5 Value 2 = 4%-8% Answer
   = Null —- It should be displayed as 0.2 – 0.4
 * Thanks in advance
    -  This topic was modified 8 years, 7 months ago by [ckourounis](https://wordpress.org/support/users/ckourounis/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fmultiplying-a-value-with-a-range%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/multiplying-a-value-with-a-range/#post-9532346)
 * Hello,
 * I’m sorry, but there is not no way to infer what you pretend calculate if you
   don’t implement the behavior you want get.
 * First, edit the values of last options of dropdown field as follows:
 * 0.045-0.08
    0.04-0.08
 * And re-implement your equation:
 *     ```
       (function(){
           var f2 = fieldname2,
               f3 = (new String(fieldname3)).split('-');
           if(f3.length == 1)
           {
             return PREC(f2*f3,2)
           }	
           else
           {
             return PREC(f2*f3[0],2)+'-'+PREC(f2*f3[1],2)
           }	
       })()
       ```
   
 * I’m sorry, but the support service does not cover the implementation of the users’
   projects (forms or formulas). If you need additional help implementing your equations
   I can offer you a custom coding service through my private website:
 * [https://cff.dwbooster.com/customization](https://cff.dwbooster.com/customization)
 * Best regards.
 *  Thread Starter [ckourounis](https://wordpress.org/support/users/ckourounis/)
 * (@ckourounis)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/multiplying-a-value-with-a-range/#post-9532736)
 * Thank you for the information. I can implement the code on my own. I have changed
   the values in the dropdown as you mentioned, but where do I put the code you 
   provided? Does it go in any particular file?
 *     ```
       (function(){
           var f2 = fieldname2,
               f3 = (new String(fieldname3)).split('-');
           if(f3.length == 1)
           {
             return PREC(f2*f3,2)
           }	
           else
           {
             return PREC(f2*f3[0],2)+'-'+PREC(f2*f3[1],2)
           }	
       })()
       ```
   
    -  This reply was modified 8 years, 7 months ago by [ckourounis](https://wordpress.org/support/users/ckourounis/).
 *  Thread Starter [ckourounis](https://wordpress.org/support/users/ckourounis/)
 * (@ckourounis)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/multiplying-a-value-with-a-range/#post-9532749)
 * Ohh sorry it goes into “Set Equation” field. Wow that’s a very complex equation.
   Thank you for all of the help. I’m rating the plugin 5 stars for how technical
   it can allow us to set an equation and because of the great support 🙂
    -  This reply was modified 8 years, 7 months ago by [ckourounis](https://wordpress.org/support/users/ckourounis/).

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

The topic ‘Multiplying A Value With A Range’ 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/)

## Tags

 * [calculations](https://wordpress.org/support/topic-tag/calculations/)
 * [range](https://wordpress.org/support/topic-tag/range/)

 * 3 replies
 * 2 participants
 * Last reply from: [ckourounis](https://wordpress.org/support/users/ckourounis/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/multiplying-a-value-with-a-range/#post-9532749)
 * Status: resolved