Title: Multiple result by a factor
Last modified: August 30, 2016

---

# Multiple result by a factor

 *  Resolved [whatachamp](https://wordpress.org/support/users/whatachamp/)
 * (@whatachamp)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/multiple-result-by-a-factor/)
 * Hi guys,
 * Wondering how to multiply the result of my formula by a factor, for example I
   have this kind of formula (just the example from your FAQ):
 *     ```
       (function(){
       if(fieldname3 > 100) return fieldname1+fieldname2;
       if(fieldname3 <= 100) return fieldname1*fieldname2;
       })();
       ```
   
 * I want to always multiply the result, whatever it is, by 0.7. But I’m having 
   trouble figuring out how to wrap the whole formula in *0.7.
 * I don’t want to edit each IF line with *0.7 because the formula is huge and its
   likely the multiplication factor will change from time to time.
 * Many thanks to anyone who can chip in with a fix!
 * [https://wordpress.org/plugins/calculated-fields-form/](https://wordpress.org/plugins/calculated-fields-form/)

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

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/multiple-result-by-a-factor/#post-6688313)
 * Hi,
 * You simply should return the equation’s result, after the conditional statements,
   and multiply by the number in the return of the equation, as follows:
 *     ```
       (function(){
       var r = 0;
       if(fieldname3 > 100) r = fieldname1+fieldname2;
       if(fieldname3 <= 100) r = fieldname1*fieldname2;
       return r*0.7;
       })()
       ```
   
 * Best regards.
 *  Thread Starter [whatachamp](https://wordpress.org/support/users/whatachamp/)
 * (@whatachamp)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/multiple-result-by-a-factor/#post-6688405)
 * Wonderful, that’s exactly what I needed – big thanks!!

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

The topic ‘Multiple result by a factor’ 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/)

 * 2 replies
 * 2 participants
 * Last reply from: [whatachamp](https://wordpress.org/support/users/whatachamp/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/multiple-result-by-a-factor/#post-6688405)
 * Status: resolved