EE 1
EE 2
Math Plus
Developer
3rd Party (Commercial)
Current Version: 1.1.1
Buy Now!
Compatibility
- LG Addon Updater
- Multi Site Manager
- Stand Alone Entry Form
Requirements
- jQuery for the Control Panel
Tags
This plugin provides support for doing simple mathematical operations in templates. There is already the plugin Simple Math which has the same purpose. Math Plus plugin differs from Simple Math only in one feature: it is required to use a tag pair instead of single tag. Tag pair allows for better control of the parse order.
PARAMETERS
1) calculate - Required. Alows you to input a string consisting of numbers,
symbols of mathematical operations and round brackets, e.g
calculate = “(10 + 5) / 3”. Examples of symbols of supported mathematical operations are:
+ (addition), - (subtraction), * (multiplication), / (division),
% (division remainder), ++ (increment),—(decrement).
2) invalid_input - Optional. Accepts two values: “alert” and “silence”.
Default value is “silence”. If the value is “alert”, then in cases when
the plugin has some problem with parameters, PHP alert is being shown;
if the value is “silence”, then in cases when the plugin has
some problem with parameters, it finishes its work without any alert being shown.
Set this parameter to “alert” for development, and to “silence” - for deployment.
3) var1, var2, var3, var4 ... var48, var49, var50 - Optional. Allows you to input numbers.
Used to gain more security - the values of these parameters will be checked if they really are numbers.
Each these parameters can be used inside “calculate” parameter. E.g. var1=“10” var2=“5” var3=“3” calculate=”({var1} + {var2}) / {var3}”
4) on_non_numeric_vars - Optional. Allows you to specify what variable {math_plus_result} should output in case
some of var1, var2, var3, etc. variables were found to be non numeric.
USAGE
Use this plugin as folllows:
{exp:math_plus calculate="(10 + 5) / 3"}
{math_plus_result}
{/exp:math_plus}
Or use it this way:
{exp:math_plus calculate="({var1} + {var2}) / {var3}" var1="10" var2="5" var3="3"}
{math_plus_result}
{/exp:math_plus}
This entry was last updated May 11, 2012, 1:26 am.
Disclaimer: Information about ExpressionEngine add-ons is provided as a service to you, the user, and every member of the ExpressionEngine community. Devot:ee is not responsible if you hose, mangle, wreck, or otherwise destroy your EE website by installing an add-on that you found out about at this site, regardless of its rating, Favorites status, commercial or free status, or general popularity. Caveat EEmptor!
1 Review:
Peter Ripley 01.06.12
This plugin works very nicely. The developer had excellent response time to my questions and added a feature at my request very quickly (overnight).
An undocumented feature is that you can pass php functions through the ‘calculate’ parameter making this a very powerful little plugin.