Title: Calculation
Last modified: October 25, 2020

---

# Calculation

 *  Resolved [almahmoud](https://wordpress.org/support/users/almahmoud/)
 * (@almahmoud)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/calculation-11/)
 * I use a calculation field with 2 number fields (the first one is required, but
   not the second). I write in the calculation field this operation: ({number-1}/{
   number-1} + {number-2}/{number-2})*5. If both fields are filled, it works perfectly(
   it appears 10 €), but if the second one is not filled, I have 0 and error. I 
   have the impression that if the second field is empty, it sends error.
    Help 
   me please Best regards

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

 *  Plugin Support [Patrick – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport12/)
 * (@wpmudevsupport12)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/calculation-11/#post-13578521)
 * Hi [@almahmoud](https://wordpress.org/support/users/almahmoud/)
 * I hope you are doing well.
 * Could you please try this solution?
 * Using:
 * `( ({number-1}/{number-1}) + ({number-2}/{number-2}) )*5`
 * In case the issue persists, kindly export the form and share using the [https://pastebin.com/](https://pastebin.com/)
   website.
 * You can find more about export the form on:
    [https://premium.wpmudev.org/docs/wpmu-dev-plugins/forminator/#import-export](https://premium.wpmudev.org/docs/wpmu-dev-plugins/forminator/#import-export)
 * Let us know the result you got.
    Best Regards Patrick Freitas
 *  Thread Starter [almahmoud](https://wordpress.org/support/users/almahmoud/)
 * (@almahmoud)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/calculation-11/#post-13578636)
 * Unfortunately, it doesn’t work. I have exported the form here
    [https://pastebin.com/G5ayi8Mu](https://pastebin.com/G5ayi8Mu)
   Thanks
 *  Thread Starter [almahmoud](https://wordpress.org/support/users/almahmoud/)
 * (@almahmoud)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/calculation-11/#post-13578681)
 * I found the issue. When number 2 is empety, this means number-2=0, so number-
   2/number-2=0/0 and it is not allowed in mathematics. I have this solution ({number-
   1}/{number-1} + {number-2}/({number-2}+1) )*5 = 5 if number-2 is empety or 10
   if number-2 is filled.
    Hope it can help some people. Best regards
 *  Plugin Support [Laura – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support8/)
 * (@wpmudev-support8)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/calculation-11/#post-13580998)
 * Hi [@almahmoud](https://wordpress.org/support/users/almahmoud/)
 * Sorry for late response and I’m glad to know that you found solution!
 * You’re right – 0/0 is not a valid operation so it will result in an error. Thanks
   for sharing that and calculation formula, I’m sure if will help some other plugin
   users if they come across similar issues!
 * Best regards,
    Adam

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

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

 * 4 replies
 * 3 participants
 * Last reply from: [Laura – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support8/)
 * Last activity: [5 years, 7 months ago](https://wordpress.org/support/topic/calculation-11/#post-13580998)
 * Status: resolved