Extension:Eval
Jump to navigation
Jump to search
See also: ParserFunctions
![]() | This extension stores its source code on a wiki page. Please be aware that this code may be unreviewed or maliciously altered. They may contain security holes, outdated interfaces that are no longer compatible etc. Note: No localisation updates are provided for this extension by translatewiki.net . |
![]() | This extension is currently not actively maintained! Although it may still work, any bug reports or feature requests will more than likely be ignored. |
Eval Release status: unmaintained |
|
---|---|
Implementation | Tag |
Description | Provides mathematical functions for MediaWiki |
License | No license specified |
Download | Extension:Eval/eval.php |
Issues | Open tasks · Report a bug |
The eval extension enables mathematical and logical operations in MediaWiki.
Installation[edit]
- Cut and paste Extension:Eval/eval.php into a text program, save the file as Eval.php
- Move the file into the extensions folder.
- Add the following line to the end of your file /LocalSettings.php:
include("extensions/eval.php");
Use[edit]
You must write the code to evaluate into the <eval> and </eval> tags. So far only it supports the following functions, but extensions are anticipated.
Code | Description |
#+# | Adds the numbers. |
#-# | . |
#*# | . |
#/# | |
(...) | |
#.# | Decimal point. |
#e# | Scientific notation (only positives). |
{{Template}} | Process the template or variable and replaces it with the returned value. Example: {{CURRENTYEAR}} |
{{{Parameter}}} | Process the parameter and replaces it with the returned value. Example: {{{1|0}}}. |
NOTE: This parser does the operations beginning at the left. Here are a few examples:
2+3*4-5 2+3*4-5 5*4-5 20-5 15 |
2+(3*4)-5 2+(3*4)-5 2+ 12 -5 2+ 12 -5 14-5 9 |
- To see the code, go to Extension:Eval/eval.php.