Title: Equation Question
Last modified: September 14, 2022

---

# Equation Question

 *  Resolved [jadmac12](https://wordpress.org/support/users/jadmac12/)
 * (@jadmac12)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/equation-question/)
 * Hello,
 * I have created a form but I’m struggling with the equation:
 * It should be fieldname1 value multiply by the fielname2 multiply by a value of
   0.52.
 * How should this be expressed?
 * Thank you

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

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/equation-question/#post-16007214)
 * Hello [@jadmac12](https://wordpress.org/support/users/jadmac12/)
 * Thank you very much for using our plugin.
 * Please, insert a calculated field in the form and enter the following equation
   through its “Set equation” attribute:
 * `fieldname1*fieldname2*0.52`
 * Straightforward.
 * Best regards.
 *  Thread Starter [jadmac12](https://wordpress.org/support/users/jadmac12/)
 * (@jadmac12)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/equation-question/#post-16011121)
 * Hi [@codepeople](https://wordpress.org/support/users/codepeople/)
 * Thanks for your response, but its not working for me for some reason.
 * Please can you check? It’s the second calculator on the page
 * [Here ](https://energyguide.org.uk/electricity-cost-calculator/)
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/equation-question/#post-16012184)
 * Hello [@jadmac12](https://wordpress.org/support/users/jadmac12/)
 * I’ll try to describe first how the plugin works.
 * When the dynamic evaluation of the equations is enabled, each time the user edits
   a field’s value, the plugin checks every calculated field in the form to identify
   the equations affected by this value and evaluate them. However, the equations’
   evaluation modifies the calculated fields’ values. So, the plugin must repeat
   the process until no field value varies.
 * So, if a field is used in its equation, it generates an endless loop. Each time
   the equation is evaluated it modifies the field’s value launching the equation
   in an endless loop.
 * The same happens when field “A” is used in the equation of field “B” and field“
   B in the equation of field “A”. The chain could be longer.
 * In your form, you create an endless loop with the fieldname1. It is a calculated
   field whose equation is `fieldname1`.
 * If it is an editable field, you can leave its equation attribute empty. Or, in
   situations where you need to use a field’s value in its equation, you should 
   use the `__ME__` constant.
 * Best regards.
 *  Thread Starter [jadmac12](https://wordpress.org/support/users/jadmac12/)
 * (@jadmac12)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/equation-question/#post-16021754)
 * [@codepeople](https://wordpress.org/support/users/codepeople/)
 * I’m extremely confused by your response.
 * So essentially, I’m trying to create a form that allows people top enter the 
   wattage of their appliance and running times in hours to get a running cot per
   hour, for example:
 *     ```
       kWh per day x unit cost = cost of electricity each day. 
   
       For example:
   
       If you had a 500W (0.5 kW) tumble dryer and operated it for the entire day (24 hours). It will use 12kWh of electricity (e.g. half a kilowatt every hour).
   
       So, if your electricity costs 52p per unit(which is the new price cap from October), then multiply 12kWh by 52p and you get a grand total of 624p, or £6.24.
   
       As mentioned previously, we used the 52p figure based on the new energy price cap for electricity that will be enforced from October 1st 2022. 
   
       However, since these figures change so often, these figures will need to be adjusted at regular intervals.
       ```
   
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/equation-question/#post-16022420)
 * Hello [@jadmac12](https://wordpress.org/support/users/jadmac12/)
 * I recommended removing the `fieldname1` from the equation of the fieldname1 field
   because it generates an endless loop.
 * Please, select the fieldname1 field in the form and let empty its equation. And
   then, select the fieldname3 and edit its equation as follows:
 * `fieldname1*fieldname2*0.52`
 * Best regards.

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

The topic ‘Equation Question’ 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/)

 * 8 replies
 * 2 participants
 * Last reply from: [codepeople](https://wordpress.org/support/users/codepeople/)
 * Last activity: [3 years, 9 months ago](https://wordpress.org/support/topic/equation-question/#post-16022420)
 * Status: resolved