Inserting calculations?
Hello editors,
I would like to use some raw numbers at base and have a more convinient number displayed to the viewer.
How can I add calculations into the wiki when I add only a number.
For starters: I want to enter 3 and have the result multiplicated by 2 and then have 1 subtracted, so it shows a 5 in the end.
Background:
I want to enter the raw testing data from shield damage and get finally a % number of how much damage an attack deals to a specific shield that people can work with and compare even shields across different star levels.
http://wiki.spiralknights.com/User:JenovaSPIRIT/Shield_Damage_Chart
Thanx, I think I got it now. Your template was very helpful and finally I know what a template actually is and how it works. By using your template I created my own here (don't worry, I will clean it up once it is fully completed):
http://wiki.spiralknights.com/User:JenovaSPIRIT/ShieldDMGPercent
Exspecially helpful proved that wiki help page with these operators
https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions
The only thing left now is a command that forces one decimale bayond the comma, even if it is zero.
aka:
it shall show a
80.0
instead of a
80
Yah, the parser functions are very unforgiving. Type one thing wrong, and it'll spit out complete nonsense on the page.
As for the decimal item, you can likely force it with remainder/modulo operators.
80.0 = 80 + 0.0 = int(800/10) + 800%10