Title: Calculating Within Function
Last modified: January 9, 2019

---

# Calculating Within Function

 *  Resolved [uamv](https://wordpress.org/support/users/uamv/)
 * (@uamv)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/calculating-within-function/)
 * It appears the MIN/MAX functions are limited to accepting single values, is that
   correct? I attempted the following calculation and encountered a javascript error.
 * `MAX( {:14} / 4, {:15} )`
 * I was able to get around this by first calculating `{:14} / 4` in a separate 
   field, then finding `MAX`. Even so, thought I’d mention this as an improvement.
 * Thanks for this plugin! Just what I’m needing at the moment.

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

 *  Plugin Author [George Mandis](https://wordpress.org/support/users/georgemandis/)
 * (@georgemandis)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/calculating-within-function/#post-11071612)
 * Thanks for the feedback! I think I found the fix and just pushed an update. Let
   me know if that’s working for you? You’re welcome to submit pull requests here:
 * [https://github.com/snaptortoise/gravity-forms-minmax/issues](https://github.com/snaptortoise/gravity-forms-minmax/issues)
    -  This reply was modified 7 years, 4 months ago by [George Mandis](https://wordpress.org/support/users/georgemandis/).
 *  Thread Starter [uamv](https://wordpress.org/support/users/uamv/)
 * (@uamv)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/calculating-within-function/#post-11072417)
 * Awesome! Thanks for the speedy response and fix! Works for me now. However, I
   did notice that if I format the calculation as follows (w/ parentheses around
   the argument – which may also be a common format), then the error remains.
 * `MAX( ( {:14} / 4 ), {:15} )`
 * Also, thanks for the Github link. Starring it now.
 *  Plugin Author [George Mandis](https://wordpress.org/support/users/georgemandis/)
 * (@georgemandis)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/calculating-within-function/#post-11074258)
 * I think it might actually be the extra set of parentheses that it’s choking on?
   I think I can push a fix for this soon though!
 *  Thread Starter [uamv](https://wordpress.org/support/users/uamv/)
 * (@uamv)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/calculating-within-function/#post-11074328)
 * Yeah, w/o that extra set it now works well. Just wanted to mention this as someone
   is bound to encounter it down the road. Thanks!
 *  Plugin Author [George Mandis](https://wordpress.org/support/users/georgemandis/)
 * (@georgemandis)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/calculating-within-function/#post-11075218)
 * Thanks for your feedback and testing! I posted another fix should be more flexible
   now going forward.
 *  Thread Starter [uamv](https://wordpress.org/support/users/uamv/)
 * (@uamv)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/calculating-within-function/#post-11075806)
 * Excellent. Thanks for your work!

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

The topic ‘Calculating Within Function’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/gf-minmax-calculation_b48fd7.svg)
 * [Gravity Forms MIN/MAX Calculation](https://wordpress.org/plugins/gf-minmax-calculation/)
 * [Support Threads](https://wordpress.org/support/plugin/gf-minmax-calculation/)
 * [Active Topics](https://wordpress.org/support/plugin/gf-minmax-calculation/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gf-minmax-calculation/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gf-minmax-calculation/reviews/)

## Tags

 * [calculation](https://wordpress.org/support/topic-tag/calculation/)
 * [improvement](https://wordpress.org/support/topic-tag/improvement/)

 * 6 replies
 * 2 participants
 * Last reply from: [uamv](https://wordpress.org/support/users/uamv/)
 * Last activity: [7 years, 4 months ago](https://wordpress.org/support/topic/calculating-within-function/#post-11075806)
 * Status: resolved