ninja_forms_calc_evaluate
Function that takes two variables and our calculation string operator and returns the result.
Description
Returns (int)
value
Parameters (3)
- 0. $op
- The op.
- 1. $value1
- The value1.
- 2. $value2
- The value2.
Usage
if ( !function_exists( 'ninja_forms_calc_evaluate' ) ) { require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/fields/calc.php'; } // The op. $op = null; // The value1. $value1 = null; // The value2. $value2 = null; // NOTICE! Understand what this does before running. $result = ninja_forms_calc_evaluate($op, $value1, $value2);
Defined (1)
The function is defined in the following location(s).
- /deprecated/includes/fields/calc.php
- function ninja_forms_calc_evaluate( $op, $value1, $value2 ) {
- switch ( $op ) {
- case 'add':
- return $value1 + $value2;
- break;
- case 'subtract':
- return $value1 - $value2;
- break;
- case 'multiply':
- return $value1 * $value2;
- break;
- case 'divide':
- return $value1 / $value2;
- break;
- }
- }