Title: Calculation Logic
Last modified: August 17, 2020

---

# Calculation Logic

 *  Resolved [jayunger](https://wordpress.org/support/users/jayunger/)
 * (@jayunger)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/calculation-logic-2/)
 * I am trying to add means to add a upcharge (reverse discount) to a donation form
   for a charitable organization that will add a fixed percentage of the donation
   amount to a total if the user elects to do so using a textbox. Unfortunately 
   constant value (eg. numbers) are not allowed in calculation formulas (a good 
   idea to add this). So I created a separate number-field for the discount percentage(
   =0.022) and used it in the formula. I also have a value for the checkbox ( =1.0).
   The formula looks like this:
 *  {donation} + ( {check-box} * ( {donation} * {number-field} ) )
 * Everything seems to work as long as the number-field is displayed in the form..
   the total calculation is increase by 2.2% but when I hide the number-field using
   a condition… the calculation comes out incorrectly to double the donation. I 
   found something similar in another topic ([https://wordpress.org/support/topic/forminator-and-coupon-code/](https://wordpress.org/support/topic/forminator-and-coupon-code/))
   but here the amount is only added in the formula not multiplied…. any idea what
   is going on here.

Viewing 1 replies (of 1 total)

 *  Plugin Support [Amin – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support2/)
 * (@wpmudev-support2)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/calculation-logic-2/#post-13268228)
 * Hello [@jayunger](https://wordpress.org/support/users/jayunger/) ,
 * I’m sorry about this issue.
 * Unfortunately, we have a bug that breaks calculation if a hidden field is used.
   It is already reported and developers are working on fixing it.
 * kind regards,
    Kasia

Viewing 1 replies (of 1 total)

The topic ‘Calculation Logic’ is closed to new replies.

 * ![](https://ps.w.org/forminator/assets/icon-256x256.gif?rev=3443182)
 * [Forminator Forms – Contact Form, Payment Form & Custom Form Builder](https://wordpress.org/plugins/forminator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/forminator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/forminator/)
 * [Active Topics](https://wordpress.org/support/plugin/forminator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/forminator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/forminator/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Amin – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support2/)
 * Last activity: [5 years, 8 months ago](https://wordpress.org/support/topic/calculation-logic-2/#post-13268228)
 * Status: resolved