Board Thread:Support Requests - Getting Technical/@comment-45183-20151004061012/@comment-5811199-20151004062835

You can use the parser function  to do calculations. There's significant amounts of help available at Help:Calculation in the Wikimedia Meta-Wiki.

If there are significant amounts of calculations, you may want to create templates that do certain calculations. An example is in the Runescape Wiki, where they have a namespace Calculator that contains several pages with  functions in templates, such as Calculator:Skill_calculators/Fishing/temp/item.

Edit: Oh, and an alternative is using Lua. A basic tutorial is available here, and rather than returning phrases, you would be using your normal +, -, /, *, %, ^ operators.