Fandom Developers Wiki

Calculator is a global Lua module for doing simple calculations on wiki pages.

Installation

Usage

The Calculator module provides several functions that can be called using {{#invoke}}:

addition
Adds two provided numbers
Input: {{calculator|<addition>|<1>|<2>}}
Output: 3
subtraction
Subtracts two provided numbers
Input: {{calculator|<subtraction>|<10>|<5>}}
Output: 5
multiplication
Multiplies two provided numbers
Input: {{calculator|<multiplication>|<3>|<10>}}
Output: 30
division
Divides two provided numbers
Input: {{calculator|<division>|<5>|<3>}}
Output: 1.6666666666667
modulo
Finds the remainder of the division of two provided numbers
Input: {{calculator|<modulo>|<5>|<3>}}
Output: 2
exponentation
Raises first number to the power of second one and returns the result
Input: {{calculator|<exponentation>|<5>|<3>}}
Output: 125


Text above can be found here (edit)