Overview

MX Calculator provides mathematical operations in ExpressionEngine 2 templates. MX Calc is build with modified class EvalMath (thanks to Miles Kaufmann) for safely evaluate math expressions.

Requirements

  1. ExpressionEngine 2

Example

you can used it as single tag
<div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">{exp</span><span style="color: #007700">:</span><span style="color: #0000BB">mx_calc&nbsp;expression</span><span style="color: #007700">=</span><span style="color: #DD0000">"-4(15/42)^23*(4-sqrt(16))-15"</span><span style="color: #0000BB">}&nbsp;</span>
</span>
</code></div>
or as tag pair
<div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">{exp</span><span style="color: #007700">:</span><span style="color: #0000BB">mx_calc&nbsp;expression</span><span style="color: #007700">=</span><span style="color: #DD0000">"-4(15/42)^23*(4-sqrt(16))-15"</span><span style="color: #0000BB">}<br />Cost&nbsp;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">{calc_result}<br />{</span><span style="color: #007700">/</span><span style="color: #0000BB">exp</span><span style="color: #007700">:</span><span style="color: #0000BB">mx_calc}&nbsp;</span>
</span>
</code></div>
is this code works? [ Test it NOW! ]
Devot:ee
Compatibility
2.5.0 2.4.0 2.3.1 2.3.0 2.2.2 2.2.1
Compatible Compatible Unsure Unsure Unsure Unsure
Enjoy this Add-on?

Name your price!

Amount:
Hint: type “0” for a free download

If you trying to find the right CMS - choose ExpressionEngine

Copyright @ 2008-2012 Max Lazar. All right reserved. Terms of Use
  • twitter
  • rss
  • digg
  • delicious
  • skype
  • dribbble
  • googleplus
  • linkedin
  • vimeo
  • flickr
  • facebook
  • twitter
Scroll to top